1 grmat158 Aug 17, 2011 21:48
3 tilqicom Aug 19, 2011 11:26
you want a different just for remote publishing ? whats the point
4 grmat158 Aug 19, 2011 12:28
Thanks for the response,
I'm using b2evolution as a lightweight CMS for part of the site. I have therefore skinned it to fit in with the rest of the website including a lot of header/footer information. That all works fine.
What I was the trying to do was enable access to individual posts, but for them I required a different look - specifically losing a lot of the header/footer and also the sidebar so that what was seen was 'just' the post content as if it wasn't actually part of the blog at all (so no comment option either).
I was able to create the skin OK and that works fine in isolation - what I was unable to do was to set the blog up to use both skins, driven by the stub that was used. When I accessed the blog through the stub for the secons skin, it ended up back displaying the first skin.
Hope that explains what I am trying to do. As I said in the last post I now have cross-posted all the entries to two blogs and use one skin on each blog. That has the desired effect, but the cross-posting struck me as being a bit OTT.
5 sam2kb Aug 20, 2011 06:58
See if this works for you
global $skin;
if( in_array( $Item->ID, array(5,2,10,66) ) )
{
$skin= 'another_skin';
}
6 grmat158 Aug 20, 2011 21:25
Thanks for that, it isn't quite what I wanted but it did give me an idea of how to solve it. I am now trying to pass a parameter on the url
e.g. myurl?skin_type=1
when I want to use the alternative skin. I then have this code
$skintype = $_GET['skin_type'];
if ($skintype == '1')
{
$skin = 'news1';
} else
{
$skin = 'news';
}
Unfortunately, this still doesn't work - although $skin gets correctly set by the parameter it doesn't successfully get passed on. I have tried just setting the skin to 'news1' and that is OK.
I'm not a php expert - what have I missed?
7 sam2kb Aug 21, 2011 18:43
Add redir=no to query params
This is a better way to catch your param.
$skintype = param( 'skin_type', 'integer' );
8 grmat158 Aug 22, 2011 17:12
excellent!! :D :D
The redir was precisely what was required - many thanks for all the good advice!
OK - found a workaround by crossposting everything to a 'parallel' blog and using the alternative skin on that - but I'm sure that isn't the most elegant solution, so if anyone comes up with the 'proper' way to do this I'd still be interested to hear it.