[request] Tempcode in Menu Link Field

Post

Posted
Rating:
#3376 (In Topic #633)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
I've implemented a system that will allow a user to have their own dynamic page on my website and I need to be able to link to this in the navigation menu.

The issue is, the link is tailored to their username, and without being able to add a $USERNAME in the LINK field of a menu item, I can't accomplish this.

Can we add functionality to use Tempcode in the LINK field when adding a menu item? This would also be useful for users who'd like to specify a full URL instead of a page and utilize $BASE_URL.
Online now: No Back to the top

Post

Posted
Rating:
#3378
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

I don't really follow the logic of the problem I'm afraid.

Surely anything you could dynamically add into a menu link, you could also dynamically add into the page itself?

Even if you need to open up the page in multiple different modes, you could have a static parameter to indicate which mode, and then the page itself would dynamically invoke whatever different variables are needed for that particular mode.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

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 Composr whenever you see the opportunity or support me on Patreon.
  • 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 Composr 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.
Online now: No Back to the top

Post

Posted
Rating:
#3379
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Oh actually maybe I do understand… the URL itself is *semantic*. You're not just supplying a URL parameter, the parameter is fundamental to how the URL is written out in a friendly way?


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

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 Composr whenever you see the opportunity or support me on Patreon.
  • 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 Composr 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.
Online now: No Back to the top

Post

Posted
Rating:
#3380
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Introducing Tempcode URLs would create some complexity and performance cost.

What I'd recommend is putting a place-holder in the URL, then modifying a template to substitute that place-holder with Tempcode.

Edit MENU_LINK_PROPERTIES.tpl.
Replace {URL*} with something like {$REPLACE*,<username>,{$USERNAME},{URL}}
Empty the template cache.
Make your menu link use <username>.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

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 Composr whenever you see the opportunity or support me on Patreon.
  • 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 Composr 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.
Online now: No Back to the top

Post

Posted
Rating:
#3388
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Here's a quick overview of how this works, to clear up any confusion:

It's more of a custom page than an entire custom site for the users. I create it because I couldn't figure out how to use Demonstratr. It is offered free to my members.

Each custom web page uses values from multiple CPF's of the user referenced in the URL and is entirely dynamic in the sense that it can automatically generate itself by displaying CPF values of any user that has been referenced in the URL. If no user is referenced then a default page is shown.

For example:
A random user goes to mysite.com/?q=fudge

The page references the profile of user fudge and uses custom profile fields to populate custom items on the page, such as a custom header or background image (assuming the user added this info to their profile).

To make a long story short, I want my members to have easy access to their own page by being able to click on their web page URL from within the navigation menu. But the link is different for each member who views it. Basically I'd need to be able to use {$USERNAME} inside the URL field of a menu item.

This would also allow them to easily copy and paste the link in case they want to give their friends the URL.

Also, another question:

These custom pages are actually in their own zone. Users have to reference mysite.com/z/?q=fudge to get there. Is there a way to add a zone exception to closing the site? So when the site is closed people can still access the /z/ zone? This would be the only exception I'd want. I just don't want members to not have access to their custom page if i'm closing the site temporarily.
Online now: No Back to the top

Post

Posted
Rating:
#3389
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Ok, well my answer above should solve your issue.

Regarding closing the site - I suggest just opening the site then using zone permissions. It's permissions which are granular.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

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 Composr whenever you see the opportunity or support me on Patreon.
  • 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 Composr 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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,052 topics, 7,195 posts, 10,831 members
  • Our newest member is kritika12
Birthdays:
Back to Top