Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2013-01-22 04:41:26
- madzzoni
- Member
- From: Grünberg/Hessen/DE
- Registered: 2013-01-22
- Posts: 38
New to TXP 4.54 - Making a Frontpage
Hi There!
After 8 successfull years with WordPress as Blog/CMS i’m finally decided to try something else as CMS! I choose TXP, because it’s seems to have the same/more freedom as WP for a “Non Developer” and not to BIG a system like Drupal/Typo3 and others to begin with ;-/…
I’ve allready set-up a new TXP Blog design, very easy indeed, – based on the original 4.54 template CSS, – installed some plugins, OK, – but i’m “stuck” in making a proper “Frontpage, Homepage, Default-page or what ever the TXP system like to call it!! (In WP you just choose your “Homepage” from the Backend!)
I tried to follow some TXP guidelines via Google Search etc., but they all seems to be “outdated” (From 2005 and so!) … I tried to search the “TXP Homepage and Forum” for help, but without success, so far…
All i want to know from “the bottom” is:
How do i make a Front/Home/Default-page with:
1. a “Sticky” Article-excerpt from a TXP article with an “fullsize” image as “Top Story, Introduction” in the “main area”? (Not shown in the news-section!) (One can edit!)
2. a list of Headlines+excerpt (with link + excerpt + “Read more”) for the 4/5 newest “blog, articles, news” entry’s just under the “Sticky” intro article in the “main area” of the (Default) page?
3. How do i set this “Frontpage” as the “index, default, start-page”? ( = http://fym.xconsult.dk)
Hope somebody here can help here!
Best regards
-Madzzoni
<TXP:n00b />
Offline
Re: New to TXP 4.54 - Making a Frontpage
- To make default page, you go to Design ((((((My textpattern is in Russian, so I could name a few things wrong)))))))))
then, sections – 1st tab.
In sections tab, there is a section called default. that is your front page. You can the page and style it uses.
Then go pages, 2nd tab, here you will see pages you can edit.
Basically, for your default section there should be a special page, which you design.
In that page for your default section you can do what you listed in #2 and #1.
Offline
Re: New to TXP 4.54 - Making a Frontpage
The way I approach a Textpattern homepage is to make a page template specifically for it (called ‘homepage’). Assign the ‘default’ section (which means the home in Textpattern speak) to use that page template.
Then also create a section called ‘homepage’ and a sticky article for that section. Make sure that section is set ‘On front page’ to ‘Yes’ and that all other sections have set ‘On front page’ to ‘No’.
You can then use that sticky article to create content just for the homepage and nowhere else, and pull it into the homepage page template with:
<txp:article limit="1" status="sticky" />
That’s handy for also creating a meta description and title for the homepage and stuff like that.
For any other sections whose articles you want to appear in the homepage page template you can pull them in using something like:
<txp:article_custom section="news" sort="posted desc" limit="3" form="news-flash"/>
Which would pull the 3 latest news articles into your homepage using a form called ‘news-flash’.
Hope that helps somewhat.
Last edited by philwareham (2013-01-22 15:08:39)
Offline
Re: New to TXP 4.54 - Making a Frontpage
philwareham a écrit:
a sticky article for that section. Make sure that section is set ‘On front page’ to ‘Yes’ and that all other sections have set ‘On front page’ to ‘No’.
You can then use that sticky article to create content just for the homepage and nowhere else, and pull it into the homepage page template with:
<txp:article limit=“1” />
Hi Phil the correct code to output a sticky article would be:
<txp:article limit="1" status="sticky" />
Last edited by Dragondz (2013-01-22 09:40:44)
Offline
Re: New to TXP 4.54 - Making a Frontpage
Ha ha, oh yeah. Good spot. Now changed in the previous post.
Offline
Re: New to TXP 4.54 - Making a Frontpage
I prefer plain HTML code to sticky.
- Along with the rest of the site I can paste the whole page into Dreamweaver and make design whatever I want, and see it on my localhost server.
- Text of the entire front page, or just parts of it can be contained in separate sticky or hidden articles, and then we can just display body text by id number anywhere in design where it is appropriate.
This allows the user to REALLY edit contents of the page without requiring knowledge of HTML.
Offline
#7 2013-01-22 14:18:33
- gour
- Member

- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: New to TXP 4.54 - Making a Frontpage
philwareham wrote:
You can then use that sticky article to create content just for the homepage and nowhere else, and pull it into the homepage page template with:
What if I want to have excerpt from the ‘newest’ article only which can come from some of the selected categories (not all) on my homepage announcing ‘latest news’ and have that article under my articles/blog section as well?
Offline
Re: New to TXP 4.54 - Making a Frontpage
gour a écrit:
What if I want to have excerpt from the ‘newest’ article only which can come from some of the selected categories (not all) on my homepage announcing ‘latest news’ and have that article under my articles/blog section as well?
Like noted by phil above only add a code like that:
<txp:article_custom category="news,anothernews" sort="posted desc" limit="3">
<h3><txp:title /></h3>
<txp:excerpt />
</txp:article_custom>
Offline
Re: New to TXP 4.54 - Making a Frontpage
@sochicomputerRU
Just to clarify: obviously when I say use the sticky for homepage content, I mean for it’s textual content, not for housing any HTML code or txp tags (that should be in the page template itself).
One should never create CMS content with HTML mixed into it (the whole ‘keep structure, style and content separate’ thing). Same goes for any txp tags, try to keep their use within actually CMS article content to a minimum – then if you decide to move to a different CMS in future your content is easier to port. You’d never do that though of course because you’ll always stick with Textpattern ;)
For example, this site I’m currently building only uses the homepage sticky article to populate the homepage meta description and homepage Facebook Open Graph data.
Last edited by philwareham (2013-01-22 16:14:15)
Offline
#10 2013-01-22 15:59:43
- gour
- Member

- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: New to TXP 4.54 - Making a Frontpage
Dragondz wrote:
Like noted by phil above only add a code like that:
Hey, this txp is really cool!!
I’m so eager to receive the book…
Offline
#11 2013-01-22 23:42:47
- madzzoni
- Member
- From: Grünberg/Hessen/DE
- Registered: 2013-01-22
- Posts: 38
Re: New to TXP 4.54 - Making a Frontpage
THX to philwareham and everyone here for your helpful TXP tip’s … Very friendly Forum here, I’ll be back if got further problems,
-madzzoni
Last edited by madzzoni (2013-01-22 23:43:35)
<TXP:n00b />
Offline
#12 2013-01-23 00:58:58
- madzzoni
- Member
- From: Grünberg/Hessen/DE
- Registered: 2013-01-22
- Posts: 38
Re: New to TXP 4.54 - Making a Frontpage
philwareham wrote:
The way I approach a Textpattern homepage is to make a page template specifically for it (called ‘homepage’). Assign the ‘default’ section (which means the home in Textpattern speak) to use that page template.
Then also create a section called ‘homepage’ and a sticky article for that section. Make sure that section is set ‘On front page’ to ‘Yes’ and that all other sections have set ‘On front page’ to ‘No’.
You can then use that sticky article to create content just for the homepage and nowhere else, and pull it into the homepage page template with:
<txp:article limit=1" status="sticky" />
That’s handy for also creating a meta description and title for the homepage and stuff like that.
For any other sections whose articles you want to appear in the homepage page template you can pull them in using something like:
<txp:article_custom section="news" sort="posted desc" limit="3" form="news-flash"/>
Which would pull the 3 latest news articles into your homepage using a form called ‘news-flash’.
——————————————-
I followed these instructions 100%, create Section and new “Sticky” Article, … but it doesn’t put anything in the content area.
Here is my new “homepage” template from the Body-tag (a copy from Default-page and edited)
<body id=”<txp:if_section name=”“><txp:if_search>search<txp:else />front</txp:if_search><txp:else /><txp:section /></txp:if_section>-page”>
<!— header —> <header role=“banner”> <hgroup> <h1><txp:link_to_home><txp:site_name /></txp:link_to_home></h1> <h3><txp:site_slogan /></h3> </hgroup> </header>
<!— navigation —> <nav role=“navigation”> <h1><txp:text item=“navigation” /></h1> <txp:output_form form=“main_menu” /> </nav>
<div class=“wrapper”> <div class=“container”><!— left (main) column —> <div role=“main”>
<!— Homepage Intro — > <txp:article limit=1” status=“sticky” />
<!— News-flash —> <txp:article_custom section=“nyheder” sort=“posted desc” limit=“3” form=“article_listing”/> </div> <!— /main —> —-<TXP:n00b />
Offline
Re: New to TXP 4.54 - Making a Frontpage
You’ve got a type in there:
<txp:article limit=1" status="sticky" />
Should be:
<txp:article limit="1" status="sticky" />
I’ve pasted the functionality you require into the original Textpattern default page like so (around line 109):
<!DOCTYPE html>
<html lang="<txp:lang />">
<head>
<meta charset="utf-8">
<!-- page title and metas, no meta keywords as they are now obsolete -->
<title><txp:page_title /></title>
<meta name="description" content="">
<meta name="generator" content="Textpattern CMS">
<txp:if_search>
<meta name="robots" content="none">
<txp:else />
<txp:if_category>
<meta name="robots" content="noindex, follow, noodp, noydir">
<txp:else />
<txp:if_author>
<meta name="robots" content="noindex, follow, noodp, noydir">
<txp:else />
<meta name="robots" content="index, follow, noodp, noydir">
</txp:if_author>
</txp:if_category>
</txp:if_search>
<!-- mobile viewport optimised, more info: http://h5bp.com/viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- content feeds -->
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:rsd />
<!-- specify canonical, more info: http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html -->
<txp:if_section name="">
<link rel="canonical" href="<txp:site_url />">
<txp:else />
<txp:if_individual_article>
<link rel="canonical" href="<txp:permlink />">
<txp:else />
<link rel="canonical" href="<txp:section url='1' />">
</txp:if_individual_article>
</txp:if_section>
<!-- css -->
<!-- Google font API (remove this if you intend to use the theme in a project without internet access) -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Serif:n4,i4,n7,i7|Cousine">
<txp:css format="link" media="" />
<!-- or you can use (faster) external CSS files eg. <link rel="stylesheet" href="<txp:site_url />css/default.css"> -->
<!-- HTML5/Media Queries support for IE < 9 (you can remove this section and the corresponding 'js' directory files if you don't intend to support IE < 9) -->
<!--[if lt IE 9]>
<script src="<txp:site_url />js/html5shiv.js"></script>
<script src="<txp:site_url />js/css3-mediaqueries.js"></script>
<![endif]-->
</head>
<body id="<txp:if_section name=""><txp:if_search>search<txp:else />front</txp:if_search><txp:else /><txp:section /></txp:if_section>-page">
<!-- header -->
<header role="banner">
<hgroup>
<h1><txp:link_to_home><txp:site_name /></txp:link_to_home></h1>
<h3><txp:site_slogan /></h3>
</hgroup>
</header>
<!-- navigation -->
<nav role="navigation">
<h1><txp:text item="navigation" /></h1>
<txp:section_list default_title='<txp:text item="home" />' include_default="1" wraptag="ul" break="">
<li<txp:if_section name='<txp:section />'><txp:if_search><txp:else /><txp:if_category><txp:else /><txp:if_author><txp:else /> class="active"</txp:if_author></txp:if_category></txp:if_search></txp:if_section>>
<txp:section title="1" link="1" />
</li>
</txp:section_list>
</nav>
<div class="wrapper">
<div class="container">
<!-- left (main) column -->
<div role="main">
<!-- is this result result page? also omits the pagination links below (uses pagination format within search_results.article.txp instead) -->
<txp:if_search>
<h1><txp:text item="search_results" /></h1>
<txp:output_form form="search_results"/>
<txp:else />
<!-- else is this an article category list? -->
<txp:if_category>
<h1><txp:text item="category" /> <txp:category title="1" /></h1>
<txp:article form="article_listing" limit="5" />
<txp:else />
<!-- else is this an article author list? -->
<txp:if_author>
<h1><txp:text item="author" /> <txp:author /></h1>
<txp:article form="article_listing" limit="5" />
<txp:else />
<!— Homepage Intro — >
<txp:article limit="1" status="sticky" />
<!— News-flash —>
<txp:article_custom section="articles" sort="posted desc" limit="3" form="article_listing" />
</txp:if_author>
</txp:if_category>
<!-- add pagination links to foot of article/article listings/category listings if there are more articles available,
this method is more flexibile than using simple txp:link_to_prev/txp:link_to_next or txp:older/txp:newer tags -->
<p id="paginator">
<txp:variable name="prev" value='<txp:older />' />
<txp:variable name="next" value='<txp:newer />' />
<txp:if_variable name="prev" value="">
<span id="paginator-l" class="button disabled">← <txp:text item="older" /></span>
<txp:else />
<a id="paginator-l" href="<txp:older />" title="<txp:text item='older' />" class="button">← <txp:text item="older" /></a>
</txp:if_variable>
<txp:if_variable name="next" value="">
<span id="paginator-r" class="button disabled"><txp:text item="newer" /> →</span>
<txp:else />
<a id="paginator-r" href="<txp:newer />" title="<txp:text item='newer' />" class="button"><txp:text item="newer" /> →</a>
</txp:if_variable>
</p>
</txp:if_search>
</div> <!-- /main -->
<!-- right (complementary) column -->
<div role="complementary">
<txp:search_input /> <!-- links by default to form: 'search_input.misc.txp' unless you specify a different form -->
<!-- Feed links, default flavor is rss, so we don't need to specify a flavor on the first feed_link -->
<p><txp:feed_link label="RSS" class="feed-rss" /> / <txp:feed_link flavor="atom" label="Atom" class="feed-atom" /></p>
<h4><txp:text item="external_links" /></h4>
<txp:linklist wraptag="ul" break="li" limit="10" /> <!-- links by default to form: 'plainlinks.link.txp' unless you specify a different form -->
</div> <!-- /complementary -->
</div> <!-- /.container -->
</div> <!-- /.wrapper -->
<!-- footer -->
<footer role="contentinfo">
<p><small><txp:text item="published_with" /> <a href="http://textpattern.com" rel="external" title="<txp:text item='go_txp_com' />">Textpattern CMS</a>.</small></p>
</footer>
<!-- JavaScript at the bottom for fast page loading, more info: http://developer.yahoo.com/performance/rules.html#js_bottom -->
<!-- add your own JavaScript here -->
</body>
</html>
On a separate note, that page might look a little long and convoluted but once you start stripping out things like the header/footer into reusable misc form snippets then the whole thing looks a lot more manageable.
Bring those snippets in using, for example:
<txp:output_form form="header" />
Also bear in mind that the ‘default’ section in Textpattern is also used for search, category lists and author lists. So that logic is also in the page code above. If you don’t intend on using those features in your site you can get rid of conditionals such as <txp:if_search> and <txp:if_author>.
Offline
#14 2013-01-23 22:41:20
- madzzoni
- Member
- From: Grünberg/Hessen/DE
- Registered: 2013-01-22
- Posts: 38
Re: New to TXP 4.54 - Making a Frontpage
Arghh philwareham, – I didn’t see the missing “ in the code either, just copy/pasted.. mmm ;-/ … But, that’s helps!!!
Now i think i begin to understand the TXP logic ;-) … and i only want to change the Form for the “homepage”, but i think it’s just to ad a new form to the TXP tag:
<txp:article limit="1" status="sticky" form="intro_homepage" />
Thanks again!
<TXP:n00b />
Offline
#15 2013-01-26 00:20:24
- madzzoni
- Member
- From: Grünberg/Hessen/DE
- Registered: 2013-01-22
- Posts: 38
Re: New to TXP 4.54 - Making a Frontpage
Hello there.
Now i got a problem with the Search-form, It doesn’t show any results, just stay on the “Homepage”!
Here is my search_input Form (default):
<form role="search" method="get" action="<txp:site_url />">
<p><input id="search-textbox" type="search" name="q"<txp:if_search> value="<txp:search_term />"</txp:if_search>><input type="submit" value="<txp:text item='search' />"></p>
</form>
Do i have to change the “<txp:site_url />” or??
My test site: http://fym.xconsult.dk
Best regards,
madzzoni
<TXP:n00b />
Offline