Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-24 12:58:33

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Default vs. Home page

Hi,
I set up a website creating some sections such as Home, Services, Contact us and so on.
Now, using the cbs_navigation_menuI created the top level navigation, and, since the home has the classical supersized header I inserted a conditional code to hide it from normal pages in the default form like:

<txp:if_section name="">
    <--! code to show if default -->
</txp:if_section>

The Home section is set to be the defaul section and to show in Home page in the sections settings.
Now, here it is the problem, if I visit the http://www.domainName.tld/ I can see the section I want to show in the homepage, while if I click on the company logo from any other section to go back to the home, visiting so the address http://www.domainName.tld/index.php?s=home the conditional code hides me the content I would like to show.
Thanks you all for you help.

Last edited by caruso_g (2009-04-24 12:58:49)

Offline

#2 2009-04-24 13:16:12

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

Re: Default vs. Home page

You probably have the same problem I had with non persistent urls. Els solved my ‘categories’ problem here .

You can adapt the code for section_lists but the main operative for you, i think, would be not to link to the section but to use

<a href="<txp:site_url />">Home</a> for your home/default page

box txp excludes the default section so by hard coding the “Home page” should always return a clean url

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

Offline

#3 2009-04-24 14:03:03

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Re: Default vs. Home page

Hi Colak,
thanks a lot for your reply.
I don’t know, the address shows the value since I left it messy in the preferences tab for development purpose.
It seems more I am missing something like “how to set up the default page/section”
I suspect I just don’t even have to create a Home section since Txp just select the default form automatically… is it that?
For the moment I just edited the </txp:if_section> code like:

<txp:if_section name=",home">
    <--! code to show if default -->
</txp:if_section>

where the comma stands for the Home section.

What do you think?

Offline

#4 2009-04-24 16:57:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Default vs. Home page

caruso_g wrote:

if I click on the company logo from any other section to go back to the home, visiting so the address http://www.domainName.tld/index.php?s=home the conditional code hides me the content I would like to show.

You probably linked the logo using the section tag, like this: <txp:section name="home">here the logo</txp:section>

If you use the code colak provided it will be solved: <a href="<txp:site_url />">Home</a>

I suspect I just don’t even have to create a Home section since Txp just select the default form automatically… is it that?

It’s correct you don’t have to create a ‘home’ section, if you want to display on the front page one or more articles from a section that also has it’s own page. But if you want to display an article there that doesn’t have to be displayed anywhere else, it’s good to create a separate section for it (I mostly use a section ‘intro’ but the name doesn’t matter of course) and set only that section to be displayed on the front page. Just don’t link to that section anywhere on the site :)

Offline

#5 2009-04-24 17:14:15

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

Re: Default vs. Home page

Els! I was waiting for you! Thanks, thanks, thanks! :)
Ok, the code is the following:

<div id="logo" class="text-replacement">
          <h1 id="site-name"><a href="<txp:site_url />" rel="home" title="Ritorna alla Home page">Website name</a></h1>
          <p id="site-slogan"><txp:site_slogan /></p>
        </div><!-- #logo -->
    </div>

Also the rel attribute is set in the <head> as <link rel="home" href="<txp:site_url />" />

It’s correct you don’t have to create a ‘home’ section, if you want to display on the front page one or more articles from a section that also has it’s own page. But if you want to display an article there that doesn’t have to be displayed anywhere else, it’s good to create a separate section for it (I mostly use a section ‘intro’ but the name doesn’t matter of course) and set only that section to be displayed on the front page. Just don’t link to that section anywhere on the site :)

Yep, that’s what I did, I use the Home section just for the intro text and images plus some article_custom to load some links and images from other section and the blog.

p.s.
I would like to thanks you all, I am really loving Textpattern, and you, its community. I was able to work with it in just a week. And I just discovered the point of the iceberg. But above all, I don’t understand how “*the other *Blog engine…**” could be more used despite its complexity… Textpattern thanks to its simplicity should be the most used cms out there… mysteries of the marketing.

Ops, I got it. I set the section name in the cbs plugin… so clicking on the navbar and not on the logo I got the issue… I am sorry, I am tired.:)
Grazie mille di nuovo Els, e Colak

Last edited by caruso_g (2009-04-24 17:16:53)

Offline

#6 2009-04-24 19:27:29

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Default vs. Home page

Di niente!

And I just discovered the point of the iceberg.

You bet :)

Offline

Board footer

Powered by FluxBB