printer_friendly_block, Forcing a theme
Hi,
I have installed the printer_friendly_block add-in,
Is it possible to force the printer_friendly_block to use a different theme ?
Currently it opens a new window, and appends index.php?page=start&wide_print=1, but is it possible to modify this so that is forces a specific template
IE index.php?page=start&wide_print=1&keep_theme=print_theme
Where and what would i need to edit to achieve this.
Many Thanks
Chris
I have installed the printer_friendly_block add-in,
Is it possible to force the printer_friendly_block to use a different theme ?
Currently it opens a new window, and appends index.php?page=start&wide_print=1, but is it possible to modify this so that is forces a specific template
IE index.php?page=start&wide_print=1&keep_theme=print_theme
Where and what would i need to edit to achieve this.
Many Thanks
Chris
Either:
1) Just put out your own print link with something like <a href="{$SELF_URL*,0,0,0,keep_print=1,keep_theme=sometheme}">Print me</a>.
2) In the BLOCK_SIDE_PRINTER_FRIENDLY template change {URL} to {$EXTEND_URL,{URL},keep_theme=sometheme}.
1) Just put out your own print link with something like <a href="{$SELF_URL*,0,0,0,keep_print=1,keep_theme=sometheme}">Print me</a>.
2) In the BLOCK_SIDE_PRINTER_FRIENDLY template change {URL} to {$EXTEND_URL,{URL},keep_theme=sometheme}.
Chris, can you explain the advantage of using {$EXTEND_URL} over, let's say something like this:
{URL}&keep_theme=default
Also, is there a list somewhere of standard/advanced URL structures/parameters that Composr uses? I'm eager to learn them
{URL}&keep_theme=default
Also, is there a list somewhere of standard/advanced URL structures/parameters that Composr uses? I'm eager to learn them
Joe said
Chris, can you explain the advantage of using {$EXTEND_URL} over, let's say something like this:
{URL}&keep_theme=default
Also, is there a list somewhere of standard/advanced URL structures/parameters that Composr uses? I'm eager to learn them![]()
From “Post #5165”, 11th Feb 2019
Because you're assume URL has a ? in it. The first parameter has to be preceded with a question mark. Different URL schemes will also use different ways of putting parameters together, so it's risky to make any assumptions.
Slightly off-topic from the original post, but I recently changed my URL's to use the logic. However, I cannot seem to get more than one extended param to work.
Whichever I place first gets added, be it _rid or keep_lang but it isn't accepting both as per the tutorial example of
Code
{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG},_rid=1}
Whichever I place first gets added, be it _rid or keep_lang but it isn't accepting both as per the tutorial example of
Code
{$EXTEND_URL,http://example.com/index.php?foo=a,bar=b}
Right, that's a bug - docs and implementation does not agree, I'll fix the implementation very soon.
KingBast said
Slightly off-topic from the original post, but I recently changed my URL's to use the logic. However, I cannot seem to get more than one extended param to work.
Code
{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG},_rid=1}
Whichever I place first gets added, be it _rid or keep_lang but it isn't accepting both as per the tutorial example ofCode
{$EXTEND_URL,http://example.com/index.php?foo=a,bar=b}
From “[solved] Missing editor toolbar on a mobile cell phone?”, 15th Feb 2019
Maybe it's possible that a bug in {$EXTEND_URL} is restricting the symbol from reading any more than 1 parameter.
Here's a possible work-around you could use; I've tested and it seems to work:
Code
{$SET,next_href,{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG}}}
{$EXTEND_URL,{$GET,next_href},_rid=1}..or you could probably just daisy-chain the {$EXTEND_URL} symbol, like so:
Code
{$EXTEND_URL,{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG}},_rid=1}Both solutions are the same, but setting a variable makes it easier to read and debug imo.
Thanks Chris and Joe. Will use the latter bit of code until the update, never thought to do it that way
Actually just do:
I've fixed the docs to correspond.
Code
{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG}&_rid=1}
I've fixed the docs to correspond.
Out of interest, does {EXTEND_URL} work differently somehow to
which is what I am currently using.
Code
{$SELF_URL,0,0,0,keep_lang={$LANG},_rid=1}
{$EXTEND_URL,{$SELF_URL,0,0,0},keep_lang={$LANG},_rid=1} and {$SELF_URL,0,0,0,keep_lang={$LANG},_rid=1} would be roughly equivalent.
EXTEND_URL would usually be used with some URL which isn't derived from the current URL.
EXTEND_URL would usually be used with some URL which isn't derived from the current URL.
Yeah, I guess the issue with SELF_URL in my case is that it keeps things like redirect=1, so I'm reverting to EXTEND_URL with CANONICAL_URL
Chris Graham said
I meant more along the lines of a list of URL parameters that are supported by Composr. For example, a list that includes parameters such as keep_theme=, wide_high= and safe_mode=, or maybe even some for debugging purposes…
Thanks.
0 guests and 0 members have recently viewed this.
