[xwiki-users] changing some layout details in a single page
Hi all, Although this issue comes from some previous threads, please, allow me to reformulate it here. I do need to change some layout appearance details in some single pages. I more or less understand how CSS now allows to change most of the layout characteristics, and how, skins are the best vehicle to apply CSS, but I don't know how to apply a skin to a single page. I've tried by adding a skin document to a page, but this doesn't work. So: 1. Is it possible to apply a skin to a page? How? 2. Is there any simpler way of using some new/different CSS definitions on a per-page basis? Thank you so much for your help, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
Hi Ricardo,
Hi all,
Although this issue comes from some previous threads, please, allow me to reformulate it here.
I do need to change some layout appearance details in some single pages.
I more or less understand how CSS now allows to change most of the layout characteristics, and how, skins are the best vehicle to apply CSS, but I don't know how to apply a skin to a single page. I've tried by adding a skin document to a page, but this doesn't work. So:
1. Is it possible to apply a skin to a page? How? 2. Is there any simpler way of using some new/different CSS definitions on a per-page basis?
What you can do is to append ?skin= at the end of your page name to force it to use that given skin, for instance : mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross (or toucan) Then you can add this code to your selected pages (it's not clean but it will work) : #if(!$request.skin || $request.skin && $request.skin != 'myskin') #set($skin = '?skin=myskin') #set($url = $xwiki.getURL($doc.fullName)) #set($pageurl = $url + $skin) $response.sendRedirect($pageurl) #end Hope this helps, Guillaume
Guillaume Lerouge wrote:
What you can do is to append ?skin= at the end of your page name to force it to use that given skin, for instance :
mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross <http://mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross> (or toucan)
Then you can add this code to your selected pages (it's not clean but it will work) :
#if(!$request.skin || $request.skin && $request.skin != 'myskin')
#set($skin = '?skin=myskin')
#set($url = $xwiki.getURL($doc.fullName))
#set($pageurl = $url + $skin)
$response.sendRedirect($pageurl)
#end
Oh! How powerful is this stuff! The "only" problem is to know how to use all the resources this framework provides us. Don't you think this must go to Code Snippets? Thank you so much, Ricardo -- Ricardo Rodríguez Your EPEC Network ICT Team
On 15/03/2008, [Ricardo Rodriguez] Your EPEC Network ICT Team < [email protected]> wrote:
Guillaume Lerouge wrote:
What you can do is to append ?skin= at the end of your page name to force it to use that given skin, for instance :
mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross (or toucan)
Then you can add this code to your selected pages (it's not clean but it will work) :
#if(!$request.skin || $request.skin && $request.skin != 'myskin')
#set($skin = '?skin=myskin')
#set($url = $xwiki.getURL($doc.fullName))
#set($pageurl = $url + $skin)
$response.sendRedirect($pageurl) #end
Oh! How powerful is this stuff! The "only" problem is to know how to use all the resources this framework provides us.
Don't you think this must go to Code Snippets?
Sure, please feel free to add it ;-) Thank you so much,
Ricardo
-- Ricardo Rodríguez Your EPEC Network ICT Team
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Guillaume Lerouge wrote:
What you can do is to append ?skin= at the end of your page name to force it to use that given skin, for instance :
mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross <http://mywiki.com/xwiki/bin/view/Main/WebHome?skin=albatross> (or toucan)
Then you can add this code to your selected pages (it's not clean but it will work) :
#if(!$request.skin || $request.skin && $request.skin != 'myskin')
#set($skin = '?skin=myskin')
#set($url = $xwiki.getURL($doc.fullName))
#set($pageurl = $url + $skin)
$response.sendRedirect($pageurl)
#end
A shorter code: #if("$!request.skin" != "myskin") $response.sendRedirect($doc.getURL("view", "skin=myskin") #end
Oh! How powerful is this stuff! The "only" problem is to know how to use all the resources this framework provides us.
Don't you think this must go to Code Snippets?
Thank you so much,
Ricardo
-- Sergiu Dumitriu http://purl.org/net/sergiu/
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Sergiu Dumitriu wrote:
A shorter code:
#if("$!request.skin" != "myskin") $response.sendRedirect($doc.getURL("view", "skin=myskin") #end
Much more elegant :-) Must this go to a code snippet entry? Thanks!
Cheers,
Ricardo
Oops! Sorry, I've misread Guillaume's last message. Adding a snippet code entry... Best, -- Ricardo Rodríguez Your EPEC Network ICT Team
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Sergiu Dumitriu wrote:
A shorter code:
#if("$!request.skin" != "myskin") $response.sendRedirect($doc.getURL("view", "skin=myskin") #end
Much more elegant :-) Must this go to a code snippet entry? Thanks!
Yes, feel free to create it. -- Sergiu Dumitriu http://purl.org/net/sergiu/
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
Sergiu Dumitriu wrote:
A shorter code:
#if("$!request.skin" != "myskin") $response.sendRedirect($doc.getURL("view", "skin=myskin") #end
Much more elegant :-) Must this go to a code snippet entry? Thanks!
Cheers,
Ricardo
Oops! Sorry, I've misread Guillaume's last message. Adding a snippet code entry...
Best,
Also, I forgot a closing ) $response.sendRedirect($doc.getURL("view", "skin=myskin")) -- Sergiu Dumitriu http://purl.org/net/sergiu/
Done! http://code.xwiki.org/xwiki/bin/view/Snippets/ForceSkinSnippet Thank you so much, Ricardo Sergiu Dumitriu wrote:
Also, I forgot a closing )
$response.sendRedirect($doc.getURL("view", "skin=myskin"))
-- Ricardo Rodríguez Your EPEC Network ICT Team
This works great for a single page, so what about a space? -- View this message in context: http://www.nabble.com/changing-some-layout-details-in-a-single-page-tp160408... Sent from the XWiki- Users mailing list archive at Nabble.com.
Mike Oliver wrote:
This works great for a single page, so what about a space?
Just edit the space preferences. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu-2 wrote:
Just edit the space preferences.
Of course, I realized just a second or so AFTER hitting submit. Ollie -- View this message in context: http://www.nabble.com/changing-some-layout-details-in-a-single-page-tp160408... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (4)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Guillaume Lerouge -
Mike Oliver -
Sergiu Dumitriu