Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-01-19 18:32:40

sunmaker
Member
From: Washington DC
Registered: 2005-01-04
Posts: 40

Re: Section does not pick up assigned page

Sorry, that has the same result.

I don’t know why I am asked to use article_custom. That tag can’t accept any attribute that tells it to use a particular page or section.

The article_custom tag can restrict to articles of a specified section, but it can no longer display an article with an entirely different section than the one it was assigned in the Write form.


All boundaries are for practical purposes only.

Offline

#14 2014-01-19 18:48:01

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Section does not pick up assigned page

I guess the guys meant

<txp:adi_gps />
<txp:if_variable name="s" value="print">
...print template...
<txp:else />
...screen template...
</txp:if_variable>

Offline

#15 2014-01-19 19:19:17

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Section does not pick up assigned page

@etc:

I suppose this works, but then it’s not a section, only a value.

Offline

#16 2014-01-19 19:23:50

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Section does not pick up assigned page

sunmaker wrote #278288:

CSS media queries can’t control TXP tags. The article must display with different output_forms for head, menus etc. It is not just turning off display of an image.

I think it’s not good practice to provide other information when you print than on the screen. What CSS can do is, for example, hide parts that are unnecessary in the print, such as images, navigation etc. and show an adapted layout for the print.

This is independent of the Textpattern tags.

Last edited by GugUser (2014-01-19 19:24:56)

Offline

#17 2014-01-19 19:36:41

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Section does not pick up assigned page

GugUser wrote #278295:

I suppose this works, but then it’s not a section, only a value.

Right, the section print is not needed anymore, its page template (edit: that I’d put in some <txp:output_form />) will go into the ...print template... part of the default page.

Last edited by etc (2014-01-19 19:41:31)

Offline

#18 2014-01-19 20:28:38

sunmaker
Member
From: Washington DC
Registered: 2005-01-04
Posts: 40

Re: Section does not pick up assigned page

The headers, menu system and other features are rendered by article_forms and output_forms and JS/CSS framework.

It makes more sense to use conditionals to load these elements only as needed instead of trying to control them with the CSS display selector.

Moreover, if a media query were used to control the format, that would not be obvious to the user looking at the site. He might well assume that if he printed the page, it would waste paper and ink with a large header image, menus, colors and other unnecessary elements – and decline to print.

In contrast, my method avoids that problem. Clicking the Print link displays the article in a printable format. Done.

After integrating the concept in #278293 into the site — using adi_gps to test for a value in the URL, then loading the appropriate headers, CSS, etc. — the issue appears to be resolved. The article_custom tag is not used, and there is no print template in the default page.

Thank you for your help.

Last edited by sunmaker (2014-01-20 20:28:52)


All boundaries are for practical purposes only.

Offline

#19 2014-01-20 09:53:49

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Section does not pick up assigned page

sunmaker wrote #278298:

In contrast, my method avoids that problem. Clicking the Print link displays the article in a printable format. Done.

I think you should use both, just in case someone decides to print the screen version.

Offline

#20 2014-01-20 12:39:09

sunmaker
Member
From: Washington DC
Registered: 2005-01-04
Posts: 40

Re: Section does not pick up assigned page

etc wrote #278308:

I think you should use both, just in case someone decides to print the screen version.

The screen version is 289 articles.
Perhaps someone may want to print all of them. It would be a lot of paper.

The print version is only a single article. Each article has its own print link. In this way, TXP does not have to display an individual article in order for the user to print that article. To my knowledge this can’t be achieved with CSS alone.

The larger issue is that Textpattern has been stiffened by removal of the developer’s ability to display any article using any section anywhere on the site at any time.

This flexibility should be restored without resorting to plugins or imperfect workarounds.


All boundaries are for practical purposes only.

Offline

#21 2014-01-20 13:22:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Section does not pick up assigned page

sunmaker wrote #278326:

The screen version is 289 articles.
Perhaps someone may want to print all of them. It would be a lot of paper.

The print version is only a single article. Each article has its own print link. In this way, TXP does not have to display an individual article in order for the user to print that article. To my knowledge this can’t be achieved with CSS alone.

The larger issue is that Textpattern has been stiffened by removal of the developer’s ability to display any article using any section anywhere on the site at any time.

This flexibility should be restored without resorting to plugins or imperfect workarounds.

Hi. Check out how we deal with article printing at neme.org. For example try to print this page, or better, print it as a pdf to save inks. No extra section is needed or used.

If you still feel uncomfortable, you could use a style switcher to shift between your print and screen styles.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#22 2014-01-20 13:39:35

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Section does not pick up assigned page

sunmaker wrote #278326:

The screen version is 289 articles.

One page with 289 articles? I don’t know the website, but I think this would be better structured. Sorry that I interfere with my opinion.

The larger issue is that Textpattern has been stiffened by removal of the developer’s ability to display any article using any section anywhere on the site at any time.

That’s not true. You can “display any article using any section anywhere on the site at any time” with txp:article_custom. The problem was the link.

Offline

#23 2014-01-20 19:39:20

sunmaker
Member
From: Washington DC
Registered: 2005-01-04
Posts: 40

Re: Section does not pick up assigned page

colak wrote #278331:

Hi. Check out how we deal with article printing at neme.org.

Could you describe how you did that? In looking at the code I don’t see media queries.

Last edited by sunmaker (2014-01-20 20:21:02)


All boundaries are for practical purposes only.

Offline

#24 2014-01-20 20:18:17

sunmaker
Member
From: Washington DC
Registered: 2005-01-04
Posts: 40

Re: Section does not pick up assigned page

GugUser wrote #278332:

One page with 289 articles? I don’t know the website, but I think this would be better structured.

The home page contains all the posts of 2013 in chronological order. That is how the client wants it at this time. Posts are not assigned categories. The site has operated successfully with this structure and TXP since 2006.

The large number of posts on the home page would frustrate the user who wants to print an individual article unless he is given an easy way to do so, which is what I am trying to do.

You can “display any article using any section anywhere on the site at any time” with “txp:article_custom”

The article_custom tag can restrict articles by section, but that is not what we need. We want to display an article using a section other than the one chosen when it was published, by passing the desired section in a link.

For example, on the website we have an article like this:

http://www.mysite.com/index.php?id=14319

This article is assigned a section, in this case, “Home” which is the default section, using the page and style applied to Home.

We have prepared a different section, let’s say “testsection”. This new section uses a different page and style than “Home”. As you recommended, that page contains:

<txp:article_custom />

So to view 14319 using testsection instead of Home, we have:

http://www.mysite.com/index.php?id=14319&s=testsection

But the result is that the article appears using the Home section. It ignores &s=testsection. I would expect it to ignore, because I see nothing in the TXP Wiki suggesting that article_custom is sensitive to a section passed in the URL.

Even if we change the article tag to this:

<txp:article_custom section=“testsection” />

it still has no effect, because 14319 was assigned Home and TXP ignores the attempt to view it using a different section.

I welcome your corrections.


All boundaries are for practical purposes only.

Offline

Board footer

Powered by FluxBB