Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-26 16:15:00

logo1664
Member
From: Oxford MS
Registered: 2011-01-23
Posts: 14
Website

Is the "landing page" always the "default" page?

I’ve been reading the Textpattern Solutions book while developing my web site. Chapter 8 talks about how sections, pages, and forms work together, and I don’t have any problem with that.

I either missed it or didn’t understand it, but how does the landing page work? Does it always use the “default” form? I briefly read through Jeff Soo’s context article http://ipsedixit.net/txp/146/textpattern-context-in-depth but not sure how it applies. For what it’s worth, I’m using the section/title permalink format.

Must I always incorporate the Default section and page into the web site? In which situations are the Default section and page used?

Thanks,
Loyd

Offline

#2 2011-01-26 16:28:25

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Is the "landing page" always the "default" page?

For section/title permlink mode, the default section would include all of these URLs:

example.com/
example.com/?q=search+term
example.com/category/blue/
example.com/author/Loyd+Goodbar/
example.com/?pg=2

The default section is used for any site page (global context, to use my nomenclature) that doesn’t specify a section, and there is, indeed, no getting away from using it.

The default page is just another page template. You can’t delete it, but you don’t have to use it. But there’s no reason not to use it for the default section. Some sites use it for all sections.

Edit: didn’t know you could delete the default page!

Last edited by jsoo (2011-01-27 01:47:51)


Code is topiary

Offline

#3 2011-01-26 18:54:50

logo1664
Member
From: Oxford MS
Registered: 2011-01-23
Posts: 14
Website

Re: Is the "landing page" always the "default" page?

jsoo wrote:

The default section is used for any site page (global context, to use my nomenclature) that doesn’t specify a section, and there is, indeed, no getting away from using it.

You can’t delete it, but you don’t have to use it.

This is probably the source of my confusion. If the default page is used in certain scenarios, how can i not use it? Someone hitting example.com/ would hit it unless I got creative with mod_rewrite. It sounds like for my needs and small site, using the default page and <txp:if_section> would be the easiest way to go.

Offline

#4 2011-01-26 19:04:06

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Is the "landing page" always the "default" page?

I’m using “page” in the confusing Txp sense of “page template”. You’re right that you must allow for someone viewing the base site URL, aka the default landing page, aka the home page. From the Txp point of view that’s the default section. The default section does not have to use the default page template; you can assign it a different template in Presentation -> Sections.

The default form is something else again :P … As with the default page template, you don’t have to use it, but you can’t delete it. (You can delete the contents, but not the form itself; same with the page template.)


Code is topiary

Offline

#5 2011-01-26 19:44:54

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Is the "landing page" always the "default" page?

jsoo wrote:

From the Txp point of view that’s the default section.

In case this helps, I think (whether right or wrong) of the “default section” as a section, but because of how it relates to other sections, also as a “section of sections” or the parent section. Or for Lord of the Rings fans, the One Ring, ah, Section, to Rule Them All. ;-) As such it is the only section that automatically can access all the other sections using txp:article.

But as Jeff notes, you still style it like any other section by associating it with any of your page styles.

Aside

jsoo wrote:

I’m using “page” in the confusing Txp sense of “page template

I love Txp, but it can be really confusing to explain to some of the folks I work with. I think we’d help the typical person better understand pages if we renamed it “Page Template” Or Page Theme. Or Page Style. Any thing but “Page” all by itself.

Last edited by maverick (2011-01-26 19:46:03)

Offline

#6 2011-01-26 19:48:47

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Is the "landing page" always the "default" page?

maverick wrote:

I love Txp, but it can be really confusing to explain to some of the folks I work with. I think we’d help the typical person better understand pages if we renamed it “Page Template” Or Page Theme. Or Page Style. Any thing but “Page” all by itself.

I agree entirely, so perhaps this will happen in Txp5 ;)

In fairness, there is some notion that the “proper name” is Page template (note the message above the textarea when editing a page/template/whatever). It’s just very unfortunate that “page” was settled on as the short form, instead of “template”.


Code is topiary

Offline

#7 2011-01-26 23:41:38

logo1664
Member
From: Oxford MS
Registered: 2011-01-23
Posts: 14
Website

Re: Is the "landing page" always the "default" page?

I think I narrowed down the question. What uses the “default” form? My Default section uses page template “br_static”. All the sections defined use either br_static or br_article page templates (still under construction).

The “home” page, http://localhost/txp/, calls the Default section, loads the br_static page template which has the following <txp:soo_if_frontpage> <p>Welcome to blackrobes.net!</p> <txp:else /> <txp:article limit="1" form="br_static" status="sticky" /> </txp:soo_if_frontpage>. This does what I expect. My “static” pages use the Sticky status.

But, whenever I go to any section page, such as localhost/txp/blog/, something is loading the Default form (I put comments in to identify it). I verified all the sections use br_static or br_article page templates. Neither of these page templates call the “Default” form.

I added comments to all the pages and forms, here is the sequence for localhost/txp/blog:

  • page template br_article
  • form misc/br_top
  • form misc/br_head
  • form misc/br_header
  • form article/default 5 times
  • form misc/br_rail
  • form misc/br_footer
  • form misc/br_bottom

Here is the relevant code from br_article: <txp:if_individual_article> <txp:article form="br_article" /> <txp:else /> <txp:article limit="5" /> </txp:if_individual_article>.

Aha! The tag reference says if not otherwise specified, <txp:article> will use form Default.

Now I’m on the right track! Sometimes talking through a problem is the solution. Also, noticed the page template Default can be removed, but not form Default. Now it makes sense.

Thanks for letting me ramble.
—Loyd

Offline

#8 2011-01-27 00:17:13

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Is the "landing page" always the "default" page?

Glad you are getting a handle on it!

Your comment strategy is a good way to get a sense of what is being pulled from where.

logo1664 wrote:

noticed the page template Default can be removed

It can be confusing! — You cannot remove the default section. You can remove the default page (template). You cannot remove the default form. How’s that for consistency! LOL

Most of it does make sense once things “click” in the learning curve. :)

Ironically – even though you can remove the default page template, it is the page template automatically assigned when a new section is created. So it’s strange that Txp let’s it be deleted. Go figure :)

Offline

#9 2011-01-27 00:28:14

logo1664
Member
From: Oxford MS
Registered: 2011-01-23
Posts: 14
Website

Re: Is the "landing page" always the "default" page?

maverick wrote:

Ironically – even though you can remove the default page template, it is the page template automatically assigned when a new section is created. So it’s strange that Txp let’s it be deleted. Go figure :)

You can’t delete page templates assigned to a section. I changed the Default section to use page template br_static. Once I did that (and removed the sections I wasn’t interested in), the Default page template can be deleted.

Offline

Board footer

Powered by FluxBB