Search
Other Snippets questions
Forum

Please help with complicated dynamic snippet

Jonathan Asbell's Avatar Jonathan Asbell
Hello Pete. Can you help me figure out why my button is not linking to the correct URL?



relevant pages and snippets
---------------------------
PAGE
www.realplaces.io/process/process-renting-out
Renting Out Process > HD Timeline > Contract to Lease & Signing

SNIPPETS
internallink-everything-about-rent
internal-link-structure
url-topics-renting-out-leasing


Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Inside your "internallink-everything-about-rent" snippet, you had:
[%snippet alias="internal-link-structure" url="[%snippet:url-topics-renting-out-leasing%]" icon="fa-file-contract" text="Everything About Rent"%]

That should be:
[%snippet alias="internal-link-structure" url="url-topics-renting-out-leasing" icon="fa-file-contract" text="Everything About Rent"%]

I must say, you have created a monster of a structure with all your nested snippets inside nested snippets inside nested snippets.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Hey Pete thanks. Let me explain why I did it that way and maybe its an innovation for your product

1) I need design consistency so that all buttons are the same with the exception of their :
- icon
- url
- text

2) I want to REUSE those buttons throughout my website on different pages such that any change to the root item changes EVERYWHERE. (I hate hunting around for stuff)
Jonathan Asbell's Avatar Jonathan Asbell
Pete is this syntax still used as in the example below?

[[snippet:query:empty-query]]

<a %handler% href="%url%?[[snippet:query:empty-query]]"><button class="uk-button uk-button-primary"><i class="fa %icon%"></i>&nbsp;&nbsp;%text%</button></a>
Peter van Westen's Avatar Peter van Westen ADMIN
What do you mean with "is this syntax still used"?

Please see the documentation on how to use Snippets, the syntax and how to pass variable values:
docs4.regularlabs.com/snippets
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
docs4.regularlabs.com/snippets/going-further/dynamic-tags

That page does not contain the syntax I shared <a %handler% href="%url%?[[snippet:query:empty-query]]"><button class="uk-button uk-button-primary"><i class="fa %icon%"></i>&nbsp;&nbsp;%text%</button></a>

I do not see [[snippet:
I do not see the key word "query" nor the use of a second colon following the keyword "empty-query"

My snippet "button-tools-send-tenant-application" is not rendering
----------------------------------------------
[%snippet alias="popup-structure" handler="popup-onclick" url="url-tools-send-tenant-application" icon="fa-file-import" text="Send Tenant Appliction"%]

It incorporates the below snippets


snippet called popup-structure with variables url, icon, text, handler and contains
----------------------------------------------
<a %handler% href="%url%?[[snippet:query:empty-query]]"><button class="uk-button uk-button-primary"><i class="fa %icon%"></i>&nbsp;&nbsp;%text%</button></a>

snippet called popup-onclick contains
----------------------------------------------
onClick="openPopup(this.href); return false;"

snippet called url-tools-send-tenant-application contains
----------------------------------------------
requests.realplaces.io/realplaces/form/S...FZxV3HS7TsS-dn-icgsc
Peter van Westen's Avatar Peter van Westen ADMIN
I have no idea where you got the [[snippet:query:empty-query]] from or what you expect it to do.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
That came from you guys =)
Can you help me know what I have done wrong. I really wish this could be easier
Peter van Westen's Avatar Peter van Westen ADMIN
That came from you guys =)
🤔… where?

Do you have a snippet called "query"?
If not, just remove that thing. If you don't know what it does and you don't know why it is there, don't use it.

Just use:
href="%url%"
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
thx
Jonathan Asbell's Avatar Jonathan Asbell
Got it to work thanks!
Jonathan Asbell's Avatar Jonathan Asbell
Pete everything was fine and now suddenly it does not work. Its not generating the correct url

Goto www.realplaces.io/process/process-renting-out

See the purple button "Everything ABout Rent" www.realplaces.io/process/process-renting-out
under the item "Contract to Lease & Signing"

Which uses [%snippet alias="internallink-everything-about-rent"%]

Which contains [%snippet alias="internal-link-structure" url="url-topics-renting-out-leasing" icon="fa-file-contract" text="Everything About Rent"%]

and "internal-link-structure" contains
<a href="%url%"><button class="uk-button uk-button-primary"><i class="fa fa-lg %icon%"></i>&nbsp;&nbsp;%text%</button></a>
Peter van Westen's Avatar Peter van Westen ADMIN
Sorry, but this is really something you should figure out yourself. This is the snippets setup you put together. So how you pass data from one snippet to another is down to how you have set it up and use it.

Going by your example, you are passing: url="url-topics-renting-out-leasing"
Which is then passed to the href: href="url-topics-renting-out-leasing"

You probably mean: url="[%snippet:url-topics-renting-out-leasing%]"
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Actually it was url="[[snippet:url-topics-renting-out-leasing]]"

Thanks Pete
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription