Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-23 01:31:12

picnichosue
New Member
Registered: 2005-12-23
Posts: 6

Displaying pages in two different page formats

Hi, I’m using textpattern to design a manual for my website. I’d like the content to be accessible to users in two ways:
  • Directly Browsing the manual using a sidebar
  • Through javascript popups triggered by “?” images on pages, like in the textpattern admin.

So I will need to have two versions of the same content: one with a sidebar, and one that is just the article content that can fit into a slimmer browser window.

What’s the best way to accomplish this? Is there a way I can do it through the url, i.e. “/users/hello/” is the normal link, and “/users/hello?format=small” is the minimal link?

Thanks in advance,

Andrew

Offline

#2 2005-12-23 16:17:34

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Displaying pages in two different page formats

Andrew-

Without fully grasping your intentions, I would think that you could use CSS to style the information two different ways. When the content is viewed in the sidebar specific CSS rules would apply. For example you could do something like:

<pre>
#sidebar p {
color: #464646;
}
</pre>

In the popup you would just set different rules to be applied. You could then use different forms (Textpattern forms) to pick which portions of the help article get displayed (title, body, etc…).

Offline

#3 2005-12-23 16:52:53

picnichosue
New Member
Registered: 2005-12-23
Posts: 6

Re: Displaying pages in two different page formats

Thanks jdykast,
I’ll try to be a little more clear…

Is there a way to choose an alternate stylesheet through a GET variable in the url?

Offline

#4 2005-12-23 19:12:56

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Displaying pages in two different page formats

Sure. Grab a plugin like chs_if_urlvar and use it along with the css tag.

Offline

#5 2005-12-23 20:53:49

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Displaying pages in two different page formats

You could also add an <code>id</code> attribute to the <code>body</code> tag of your help window. Using that specific id gives you the ability to have a different set of rules within the same style sheet. This method is used all over the place to give the active item within a navigation menu different styling than the other items. (See someone like simplebits.com as an example.)

Your CSS might look something like this

<pre>
p {
/* Non help file style */
color: green;
}

#help p {
/* Help file style */
color: red;
}
</pre>

Offline

Board footer

Powered by FluxBB