Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-01-16 09:23:13
- Steerpike
- Member
- Registered: 2006-01-03
- Posts: 11
Articles show on main page, but not in their own section
I downloaded and installed TextPattern a few days ago and had it working ‘just fine’, with several sections.
I just got done applying ‘Gentle Calm’ layout, and I have run into a problem. It’s highly likely I made a mistake, but I can’t find it! Here’s the problem – hopefully, this is an ‘obvious’ symptom for someone with experience:
I setup a Section called ‘GentleSection’, which uses page ‘default’ and style ‘GentleStyle’ (I chose to name the style this way to preserve the default style in case I wanted to use it for other purposes). I set this section to display on front page.
I create a new article, ‘Test Gentle Article’ and assign it to the section ‘GentleSection’. After posting, I can see the new article on my home page (“mysite”/textpattern/), as expected. When I click on the article title, the url shows this: “mysite”/textpattern/GentleSection/12/testgentlearticle – but the ‘content’ area of the screen is blank.
I get the same result when trying to display any of my numerous sections.
I’ve checked all the instructions for loading the layout. I AM using a subdirectory of ‘/textpattern/’ right now on my site, but I followed the extra instructions for dealing with that. Prior to applying this layout, sections were working fine.
Pointers, anyone? Thanks!
Last edited by Steerpike (2006-01-16 09:27:22)
Offline
#2 2006-01-16 14:42:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Articles show on main page, but not in their own section
Do you have something like
<code>
<txp:if_section name=“GentleSection”>
<txp:article />
</txp:if_section>
</code>
on your default page?
Offline
#3 2006-01-16 17:30:54
- Steerpike
- Member
- Registered: 2006-01-03
- Posts: 11
Re: Articles show on main page, but not in their own section
Thanks. No, nothing like that; I presume if I had that, then ‘only’ items from ‘GentleSection’ would show up on the home page, but ‘all’ sections (at least, all sections having ‘on front page’ checked) show up on the home page.
At first, I thought maybe it was the fact that I had pre-existing sections that were somehow created ‘illegaly’ (existing prior to the application of the Gentle Calm layout) which is why I created a new section GentleSection and a new article assigned to it, as a test.
Like I said, when I click on the article title, the url shows this: “mysite”/textpattern/GentleSection/12/testgentlearticle – but the ‘content’ area of the screen is blank. If I change the url to be
“mysite”/textpattern/GentleSection/ , the same behavior occurs. Same occurs for any Section – except, ‘article’ section – that does work. Note – there are no errors; right-hand-side objects still appear (navigation, etc) but the main area is blank/empty.
I’ve switched ‘uses style’ for ‘GentleSection’ from ‘GentleStyle’ to default; no change.
I switched ‘uses page’ for ‘GentleSection’ from default to archive; no change.
Any other thoughts? Getting Sections to work is crucial for my intended use. Thanks!
Last edited by Steerpike (2006-01-16 17:34:45)
Offline
#4 2006-01-16 20:41:00
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Articles show on main page, but not in their own section
There are some pointers in the FAQ that might help. In particular, check your tag trace for the <txp:article />
tag.
Alex
Offline
#5 2006-01-17 07:56:45
- Steerpike
- Member
- Registered: 2006-01-03
- Posts: 11
Re: Articles show on main page, but not in their own section
Thanks for the pointers. There are no errors displayed in Testing mode (when viewing source). I think I discovered what the problem is though … in the default page code, I see this:
<code>
<txp:ob1_if_section section=“default”> <!— default section —>
<txp:article form=“default” limit=“3” listform=“default” />
<txp:output_form form=“postnavigation” />
</txp:ob1_if_section> <!— end default section —>
</code>
(note – took me a while to figure out that I needed to use < code > … < /code > tags and not [code] … [/code] when pasting code in the forum! The forum help suggests the [] form! )
There are several such blocks of code, with different ‘section=“name” ‘ blocks. So this suggests there needs to be specific ‘page’ code for each section you want displayed, which makes little sense to me – is the design of this layout such that for each new section you have to write ‘page’ code … surely not.
I tested this theory two ways; I hacked the condition from ‘section=“default” ‘ to ‘section=“GentleSection” ‘ and, my section appeard (not pretty, etc, but – appeared). A second test was to simply insert <code> <txp: article /> </code> right above the block of conditions, and my article appeared.
I apologize to Doggiez – I guess I see now what he was getting at – it seems I “MUST” write such code in order to get my sections to display … which seems counter-intuitive to me!
I have asked in another post if the layout used by the TextPattern site itself is available; I like it more than any other layout … but no one has responded.
Last edited by Steerpike (2006-01-17 18:54:38)
Offline
#6 2006-01-20 16:26:30
- Steerpike
- Member
- Registered: 2006-01-03
- Posts: 11
Re: Articles show on main page, but not in their own section
Can anyone give me insight into the use of ‘sections’ in TextPattern, when using different layouts?
I abandoned the ‘Gentle Calm’ layout, assuming maybe it was just incompatible with my needs, and applied the ‘reflection’ layout instead. I have the same situation, in that posts assigned to any ‘non-standard’ section (that is, to any section I created, a section other than ‘article’ or ‘about’ or whatever) do not display.
In looking at the ‘page template’ code for the ‘default’ page, I see conditional code that starts as follows:
<code>
<txp:if_section name=“about”>
<txp:article form=“Single” />
</txp:if_section>
</code>
There is similar code for the ‘contact’ section.
This tells me that this page is only going to output my content if my content is assigned to (eg) the ‘about’ section, or the ‘contact’ section, etc. So this raises the more general question/concern:
Textpattern seems to be designed to support multiple sections. But if you do, any content assigned to these sections does not display if you apply various different ‘layouts’, since the layouts seem to have no provision for displaying non-standard sections. Knowing this, I can of course simply go in and either a) edit the page template code for the default page to include my new sections, or b) create new page templates for my new sections. Not exctly hard, but – seems to be an odd design. Should not a ‘default’ page template display content from all sections, by … well, by ‘default’? The whole idea of a ‘default’ something or other is that it is the catchall, the base, the thing that comes into play if there is no more specialised page template.
Or am I just completely missing the point here? Thanks!
(note: the topic title suggests content from all sections shows on main page, but with ‘reflection’ layout, doesn’t even display there – it did with Gentle Calm)
Last edited by Steerpike (2006-01-20 16:30:59)
Offline