Difference between revisions of "News Section Templating"

From TMM Wiki
Jump to navigationJump to search
m
 
 
Line 7: Line 7:
 
<pre>
 
<pre>
 
{assign var="news_mm" value="1"} <!--  This value creates different subsets -->
 
{assign var="news_mm" value="1"} <!--  This value creates different subsets -->
{assign var="news_d" value="standard"} <!--  Change this value to the appropriate template -->
+
{assign var="news_d" value="members"} <!--  Change this value to the appropriate template -->
 
{assign var="news_p" value="10"} <!-- Change this value to X most recent news items  -->
 
{assign var="news_p" value="10"} <!-- Change this value to X most recent news items  -->
 
<tr>
 
<tr>
Line 39: Line 39:
 
<pre>
 
<pre>
 
{assign var="news_mm" value="1"}
 
{assign var="news_mm" value="1"}
{assign var="news_d" value="standard"}
+
{assign var="news_d" value="members"}
 
{assign var="news_p" value="X"}
 
{assign var="news_p" value="X"}
 
{include_php file="news.php"}
 
{include_php file="news.php"}

Latest revision as of 16:14, 28 January 2009

NATS 3
Skins & Templates Admin
Smarty Plugins
Skins
Editing Skins
Creating Skins
Switching Skins
Templates
nats_code
Affiliate Stats Template
Affiliate Support Template
Affiliate Login Template
custom errors.php
Template Array Variable
Detailed Stats
NATS Variables
Dialer Statistics
Affiliate Signup
Post URL Variables
Member Usernames & Passwords
Output An Affiliate's Last Paid Date
Custom Program and Campaign Selection Pages
CAPTCHA Removal
Username Recommendations
Password Retrieval
Post-Biller Templates
Geo-Target Join Options
Template Caching
Random Usernames and Passwords
Base Templates
Protecting Template Data
Mail Reseller Signup Template Variable Names
Smarty
Smarty print array
News Section Templating
Affiliate Signup Email
Getting The NATSCode
Checking for Usernames on All Sites
Adding Stats to Affiliate Pages
Affiliate Join Page Linkcodes

You can add the news section to any template in the NATS by including the following code on the page where you want the section to appear:

{assign var="news_mm" value="1"} <!--  This value creates different subsets -->
{assign var="news_d" value="members"} <!--  Change this value to the appropriate template -->
{assign var="news_p" value="10"} <!-- Change this value to X most recent news items  -->
<tr>
   <td>{include_php file="news.php"}</td>
</tr>

The news_mm parameter creates different subsets of news. You may have up to 255 different subsets. value="1" shows the standard one that appears on members.tpl. Use value="2" to create a news section specifically for administrators or the external part of the site.

The news_d parameter selects the template to use for the news. NATS provides you with two templates:

  • news_members.tpl
  • news_standard.tpl

If you want to create your own section, make a copy of one of the above in the Skins and Templates Admin.

The news_p parameter tells NATS how many news items to display.

Displaying More Than Three News Items

You can make the news section display more than three news items by finding the following piece of code,

{$news}

And replacing it with:

{assign var="news_mm" value="1"}
{assign var="news_d" value="members"}
{assign var="news_p" value="X"}
{include_php file="news.php"}

In the line: {assign var="news_p" value="X"} change the 'X' to the number of news items you want displayed.

Linking to the News Page

Add links to your member_disp_news template that will rebuild the query string while adding the appropriate section name (i.e. members, or standard). Example:

<a href="internal.php?page=disp_news&nd=members&{rebuild_query}">Members</a>
<a href="internal.php?page=disp_news&nd=standard&{rebuild_query}">External</a>

You will then have to edit the template in news_members and news_standard template to pass "nd" to every link and as a hidden input for every HTML form in these templates. For example:

{*THIS...*}
<a href="internal.php?page=disp_news&nmm={$smarty.request.nmm}&nsa=edit&ned={$newsitems[newsitem].id}">

{*BECOMES...*}
<a href="internal.php?page=disp_news&nmm={$smarty.request.nmm}&nsa=edit&ned={$newsitems[newsitem].id}&nd={$smarty.request.nd}">

To access the page to edit news items, please go to http://domain/internal.php?page=disp_news

  • Replace domain with your domain.