HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


can menus use variables?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#78258 (In Topic #16040)
Avatar

Community saint

In my gallery zone, I want to have an item in the menu called: 'Your Gallery' so a user can go straight to their gallery.

I was messing with the menu editor, I can get "mgalleries:galleries:type=misc:id=member_2_root"  which would go to a particular users gallery, but is there a way to replace '2' with the member id # so it goes to that members gallery?

Paul
Back to the top
 
Posted
Rating:
#78262
Avatar

I think you can put {$USER} in there.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#78263
Avatar

Community saint

nope.

hmm, maybe I will have to make a 'menu' side block to do it.


Paul
Back to the top
 
Posted
Rating:
#78264
Avatar

Pretty sure you can, because this is what the personal zone does for it's menu. I can't say I've tested it for the case where the variable isn't a full page-link component though.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#78266
Avatar

Community saint

Ah, they use {$USER_OVERIDE}.

If I do id={$USER_OVERIDE} it works, but if you do it as you need to for galleries, it does not.  Since gallery id's  are member_x_root …

strange.

Paul
Back to the top
 
Posted
Rating:
#78272
Avatar

Ah yes, you're right.

I've checked the code, it's been heavily optimised because it is a key part of every page render. It only checks for '{' at the start of a page-link component for performance.

There are two workarounds…
  1. Do mgalleries:galleries:misc:{$,}member_{$USER}_root
  2. Do a URL instead of a page-link

1 works because {$,} is a Tempcode comment and makes it realise it will have to do "late binding".. i.e. turn off the optimisation

2 works because the URL rendering path is not so heavily optimised


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#78291
Avatar

Community saint

Ah, makes sense.   I'll go with option 1.

I am guessing that means that using that method, you can also use other 'built in'  variables like $USER.

Thanks.

Paul
Back to the top
 
Posted
Rating:
#78292
Avatar

yes


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: