Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2008-09-22 19:10:06
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: sections link straight to the article
Checked??
Offline
Re: sections link straight to the article
I meant what should happen when a visitor arrives at your /about page – what do you want them to see? Then we can help you figure out how to markup your TXP about page template….
As to your latest question:
Section list – see the active_class=“class name” part, and set your active class in your CSS accordingly.
Offline
Re: sections link straight to the article
One thing I’ve done in the past is to create a custom field called “Section_Home_Page”, you populate it with yes or no then you can use
<txp:if_article_list>
<txp:article Section_Home_Page="yes" limit="1" />
</txp:if_article_list>
<txp:if_individual_article>
<txp:article limit="1" />
</txp:if_individual_article>
which will display the article marked as “Section_Home_page” when you are on an article list (section page) otherwise it will show the regular article. This allows for /section/title urls. which I prefer over /title urls.
I use glz_custom_fields to make the custom field a simple checkbox. Works pretty well.
It would be nice to be able to select an article based on url-title so you could have a pattern that an article with the same name as the section gets used as the section home page (there’s probably a plugin that will do that, I haven’t looked)
Shoving is the answer – pusher robot
Offline
Re: sections link straight to the article
jstubbs wrote:
I meant what should happen when a visitor arrives at your /about page – what do you want them to see? Then we can help you figure out how to markup your TXP about page template….
As to your latest question:
Section list – see the active_class=“class name” part, and set your active class in your CSS accordingly.
When a visitor arrives at my /about page some text is to be shown. The same goes for /portfolio, /contact etc…so I think I successfully sorted it out.
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
the active_class is working great! I did this:
<txp:section_list active_class=“section_list_active” wraptag=“ul” break=“li” />
with the following style:
.section_list_active {
font-weight: bold;
}
I was wondering how I could have a given section “active” as default…can it actually be done?
thanks
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
my last questio is how can i redirect from default page to a given page? thanks
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
just for the records those are the page template and form display:
http://www.theartofweb.net/txt/textpattern_page.txt
http://www.theartofweb.net/txt/displayarticle.txt
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
theartofweb wrote:
my last questio is how can i redirect from default page to a given page? thanks
Not quite sure I understand the question – can you give an example of what you mean?
Offline
Re: sections link straight to the article
suppose my site is www.mysite.com i would like to be redirected at www.mysite.com/about
in a nutshell i do not want any default page
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
Why don’t you just have your About details on the front page?
1. In the Sections tab, assign your about section to “On front page?” == yes
2. In your page (or create a form and then use the output_form tag to place it in your page), use something like this:
<txp:section_list sections="overview, installing, broadcasting, listening, developer, donate" default_title="about" active_class="section_list_active" wraptag="ul" break="li" />
That might do what you want.
Offline
Re: sections link straight to the article
Another option: redirect from the .htaccess, or use zem_redirect (pro) (a txp plugin). it’s linked somewhere here in the forum… but I’m in “lazy mode”.
Offline
Re: sections link straight to the article
jstubbs wrote:
bq. Why don’t you just have your About details on the front page?
1. In the Sections tab, assign your about section to “On front page?” == yes
2. In your page (or create a form and then use the output_form tag to place it in your page), use something like this:
bc. <txp:section_list sections=“overview, installing, broadcasting, listening, developer, donate” default_title=“about” active_class=“section_list_active” wraptag=“ul” break=“li” />
That might do what you want.
I do have about details on the front page. I’d like to set active_class=“section_list_active” as default for “about” section in the left sidebar.
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
Take another look at the code I posted above, you might find that it does what you want. Have you tried the code yet to see if it works for you?
Offline
Re: sections link straight to the article
yeah I did try it, yet it didn’t work. I am thinking of making a simple redirect hatml page and set default section to load it :-(
Alla batteria dai retta ballA
Offline
Re: sections link straight to the article
Can you tell us why it does not work? I think I still don’t quite know what you want :-)
If you just want to redirect to /about then think its best to follow maniqui’s advice and use .htaccess or zem_redirect.
But if you just want your about section to be your front page, what I showed you above should work, albeit perhaps with a tweak here or there.
Offline