Jump to content

How do I customize href routePath in .tpl files? Convert cat id to catname in permalink


cdeese8

Recommended Posts

How do I control the routePath output? I'm trying to customize the permalink so it spits out {$kbarticle.categoryname} instead of {$kbarticle.categoryid}

domain.com/knowledgebase/{$kbarticle.categoryid}/{$kbarticle.title}
(currently)

domain.com/knowledgebase/{$kbarticle.categoryname }/{$kbarticle.title}
(what would be nice)

Using WHMCS 7.4.1 with default template, I notice on the knowledgebasecat.tpl page <a href="{routePath('knowledgebase-category-view',{$kbcat.id},{$kbcat.urlfriendlyname})}"> but when I use "find in file" search in Sublime nothing is found.

Might you have any wisdom to share, perhaps a hook replacement or even smarty replace?

Edited by cdeese8
added links and tag
Link to comment
Share on other sites

20 minutes ago, cdeese8 said:

How do I control the routePath output?

you don't - it's an undocumented, mysterious encrypted feature that works by black magic. 🧙‍♂️

22 minutes ago, cdeese8 said:

Using WHMCS 7.4.1 with default template, I notice on the knowledgebasecat.tpl page <a href="{routePath('knowledgebase-category-view',{$kbcat.id},{$kbcat.urlfriendlyname})}"> but when I use "find in file" search in Sublime nothing is found.

hardcode the link with a category name and see if it works.. chances are that routepath is only designed to work with specific variables, but you never know.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated