JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Nov 11, 2022 15:13:31 GMT -8
Hi - quick question...
Are there specific custom page variables? such as: $[custom_page.id] or $[custom_page.title] ? If there are not, can we request them somewhere or is there a plugin/modification/html work around that will let me make them, or an effect similar to using them? Specifically the ID one - this would be amazingly helpful.
My aim is to have css linked to custom pages (different code per page) by using their ID as a div class. But in doing that, I'll need to rewrite the ID into the div class for every page. Instead, I'd like to be able to use the HTML <div class="$[custom_page.id]"></div> which means I would only have to copy and paste the same code into each page.
Hope this makes sense!
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Nov 12, 2022 16:15:23 GMT -8
bump <3
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Nov 12, 2022 21:57:27 GMT -8
Hi - quick question... Are there specific custom page variables? such as: $[custom_page.id] or $[custom_page.title] ? If there are not, can we request them somewhere or is there a plugin/modification/html work around that will let me make them, or an effect similar to using them? Specifically the ID one - this would be amazingly helpful. My aim is to have css linked to custom pages (different code per page) by using their ID as a div class. But in doing that, I'll need to rewrite the ID into the div class for every page. Instead, I'd like to be able to use the HTML <div class="$[custom_page.id]"></div> which means I would only have to copy and paste the same code into each page. Hope this makes sense! The global variable $[route] should provide that info {* Are we on a custom page? *} {if $[route.name] == 'page'}
<div class="page-$[route.params.page_id]">Lori eats epsom salt</div>
{/if}
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Sept 27, 2024 15:01:41 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Nov 16, 2022 0:21:20 GMT -8
That worked perfectly Chris Thank you!
|
|