test
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • dotflashop Friend
    #151259

    Hello everyone, i use the wonderful zeolite II.

    I’d like to change the initial part of the breadcrumb, I would give a message if my virtuemart user is logged or not.

    If the user is logged in, I would like to appear:
    Hi John, You are in Home> Shop> etc..

    Now, like a perfect newbie that i am, i write:

    <? Php
    if ($ login) (
    <? Php echo (‘username’);?>< jdoc: include type = “module” name = “breadcrumbs,” />
    else
    <? Php echo JText ::_(‘ You are here’);?>
    end if
    ? Php>

    Ok, The syntax is incorrect but I believe that the flow is correct. I tried to see which variables use the vm login form, but trying to convey the same variables, I have error call.

    Anybody know the resolution of the problem or how to act? My research in this forum have not been successful and I apologize if I have not searched well.

    Thanks and have a good day

    dotflashop Friend
    #344326

    Excuse me, the correct example is:

    <? Php
    if ($ login) (
    <? Php echo (‘username’);?>< jdoc: include type = “module” name = “breadcrumbs,” />
    else
    < jdoc: include type = “module” name = “breadcrumbs,” />
    end if
    ? Php>

    toymaker Friend
    #344377

    Hi dotflashop,
    You can try this code…


    <?php
    $user =& JFactory::getUser();
    if ($user->guest) { ?>
    <?php echo JText::_('You are here');?></strong><jdoc:include type="module" name="breadcrumbs" />
    <?php } else { ?>
    <?php echo 'Hi '.$user->name.', '.JText::_('You are here');?></strong> <jdoc:include type="module" name="breadcrumbs" />
    <?php } ?>

    This example is using and accesing the current user object. You can reference a whole lot of info from it… the user’s name is only one of them.
    Read more about it here: http://docs.joomla.org/Accessing_the_current_user_object

    Hope it helps 😉

    Peace,
    Gabriel

    dotflashop Friend
    #344419

    Hi Gabriel, your answer is very helpfull for me, vamos la leche! es lo que buscaba!

    gracias

    toymaker Friend
    #344420

    😀 Awesome!

    Cuando quieras colega! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 2 voices, and was last updated by  toymaker 14 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum