-
AuthorPosts
-
May 22, 2010 at 1:54 pm #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
May 22, 2010 at 1:58 pm #344326Excuse 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 Friendtoymaker
- Join date:
- April 2010
- Posts:
- 123
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 10
- Thanked:
- 45 times in 32 posts
May 23, 2010 at 2:25 am #344377Hi 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_objectHope it helps 😉
Peace,
GabrielMay 23, 2010 at 3:41 pm #344419Hi Gabriel, your answer is very helpfull for me, vamos la leche! es lo que buscaba!
gracias
-
AuthorPosts
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