Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2007-12-28 19:26:23
- haelen
- Member
- Registered: 2007-11-13
- Posts: 14
Re: "Static" Home Page displaying, but not other content.
Unfortunately that doesn’t work.
I can’t seem to contact you via e-mail either. When I click on your name for your profile I get a message which says I don’t have permission to view.
You can contact me at timothyrowe at gmail dot com & I can give you a login id for my site.
Offline
Offline
#27 2007-12-31 03:53:40
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Re: "Static" Home Page displaying, but not other content.
We’ve got our home page set up as “regular” index.php outside of Textpattern. PHP includes the DataConnect, then:
// Delve into the textpattern database to get news stories for the home page $recentNewsCat = '01. Recent News'; $archivedNewsCat = '02. News Archives'; $dc = new DataConnect(); $dc->connect(); $sql = "SELECT * FROM textpattern WHERE (Category1 ='$recentNewsCat' OR Category2 = '$recentNewsCat')" . " AND Status = 4 ORDER BY LastMod DESC LIMIT 4"; $news_rs = $dc->execute($sql);
.. And in the page where the News articles are displayed:
<?php // Show the news stories if there are any echo('<div id="newslist">'); echo('<h3>News</h3>'); echo('<ul>'); while($row = mysql_fetch_array($news_rs)) { echo('<li><strong>'.$row['Title'].'</strong><br /><span class="lastupdated">Posted '.date("F j, Y",strtotime($row['LastMod'])).'</span><br />'); echo($row['Excerpt'].' '); //echo('<br /><div align="right">[ <a href="txp/?s=News&id='.$row['ID'].'">Continue "'.$row['Title'].'"...</a> ]</div></li>'); echo('<br /><div align="right">[ <a href="txp/?s=News&id='.$row['ID'].'">Read More...</a> ]</div></li>'); } echo('</ul>'); echo('<p><a href="txp/?s=News&c='.$archivedNewsCat.'">View More News Stories</a></p>'); echo('</div>'); //}
You may have your TXP url’s set up to be ‘cleaner’ than ours. — Good luck! Vicki
Offline
Re: "Static" Home Page displaying, but not other content.
With the glx_if plugin you could have something like this in your default template.
<txp:glx_if_frontpage>
<p>Your static content here<br />
and/or you could call an article id like the suggestion above<br />
<txp:article_custom id="123" /><br />
Or you can have more complex content by including it in a form called frontpage like:
<txp:output_form form="frontpage" /></p>
<txp:else />
<txp:article />
</txp:glx_if_frontpage>
>Edited to add more options
Last edited by colak (2007-12-31 09:06:26)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline