printer_friendly_block, Forcing a theme

Post

Posted
Rating:
#4822 (In Topic #973)
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

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#4823
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}.

Post

Posted
Rating:
#4831
Joe
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 :)

Post

Posted
Rating:
#4833

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 :)

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.

Composr Tutorial: URL Schemes in Composr

Open Source CMS with advanced social, interactive and dynamic features. Fully flexible, themeable and extendible: suitable for building powerful websites.

View


Post

Posted
Rating:
#4840
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 of

Code

{$EXTEND_URL,http://example.com/index.php?foo=a,bar=b}

Post

Posted
Rating:
#4841
Right, that's a bug - docs and implementation does not agree, I'll fix the implementation very soon.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#4842
Joe

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 of

Code

{$EXTEND_URL,http://example.com/index.php?foo=a,bar=b}


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.

Post

Posted
Rating:
#4844
Thanks Chris and Joe. Will use the latter bit of code until the update, never thought to do it that way :P

Post

Posted
Rating:
Item has a rating of 1
#4846
Actually just do:

Code

{$EXTEND_URL,{$CANONICAL_URL},keep_lang={$LANG}&_rid=1}

I've fixed the docs to correspond.

Post

Posted
Rating:
#4850
Out of interest, does {EXTEND_URL} work differently somehow to

Code

{$SELF_URL,0,0,0,keep_lang={$LANG},_rid=1}
which is what I am currently using.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#4851
{$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.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#4852
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 ;)

Post

Posted
Rating:
#4858
Joe

Chris Graham said

Joe said

Also, is there a list somewhere of standard/advanced URL structures/parameters that Composr uses? I'm eager to learn them :)

Composr Tutorial: URL Schemes in Composr

Open Source CMS with advanced social, interactive and dynamic features. Fully flexible, themeable and extendible: suitable for building powerful websites.

View




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.

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam EdingtonLiked by Joe)
#4859

Code Book, part 3 (Miscellany)

Open Source CMS with advanced social, interactive and dynamic features. Fully flexible, themeable and extendible: suitable for building powerful websites.

View


0 guests and 0 members have recently viewed this.