Results 1 to 10 of 10
  1. #1
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0

    Page number variable

    What is the variable for the page number?
    I want to make it so something shows on the first page of every category, but not on the second or so on. Thanks.

  2. #2
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,511
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    This is a slightly modified bit of code from the pagename variable wiki article
    Code:
    {if count($templatelite.get) == 0}First Page Content {/if}
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  3. #3
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    Thanks, I ended up putting this code in
    {if count($templatelite.get) == 0 || count($templatelite.get) == 1}CONTENT{/if}
    This makes it so when Im on the home page or page 1 (of pagination) it shows my content.
    Thanks again

  4. #4
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    Spoke too soon. With the way I set it up it is showing on every page.

  5. #5
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    What i'm trying to do is to set up different styles for my stories when they are on my home page or either category. Here is how I have my link_summary set up.
    {if $pagename eq "story" || $pagename eq "submit"}
    <div class="stories-wide" id="xnews-{$link_shakebox_index}">
    {elseif $pagename eq "user"}
    <div class="stories-user" id="xnews-{$link_shakebox_index}">
    {elseif $link_shakebox_index eq 0}
    <div class="stories1" id="xnews-0">
    {elseif $link_shakebox_index eq 1 || $link_shakebox_index eq 4}
    <div class="stories2" id="xnews-{$link_shakebox_index}">
    {elseif $link_shakebox_index eq 2}
    <div class="stories3" id="xnews-{$link_shakebox_index}">
    {elseif $link_shakebox_index eq 3}
    <div class="stories4" id="xnews-{$link_shakebox_index}">
    {else}
    <div class="stories" id="xnews-{$link_shakebox_index}">
    {/if}
    What I want is for the styling for link_shakebox_index 0-4 to only show on the first page of home and each category. Otherwise I want it to be the default "stories" styling. I hope this help explain what I'm trying to do. Thanks.

  6. #6
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    ---bump---

  7. #7
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    Anyone know?

  8. #8
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,511
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    So is the problem with /page/1/ links not working with:
    Code:
            {if $pagename eq 'upcoming' && count($templatelite.get) == 0}
                First Page Upcoming Content
            {elseif $pagename eq 'index' && count($templatelite.get) == 0}
                First Page Homepage Content
            {/if}
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  9. #9
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    Yes, when im on my home page the classes of my {$link_shakebox_index} 0-4 are the way I want them. The if I go to page 2 it changes the classes like it is supposed to. Then if I click on page 1 in the pagination, it doesn't change the classes back the way they were. Also when I select a category, it isn't recognizing that {count($templatelite.get) == 0 and doesn't have the classes set the way I want them. Here is what I have set up in link_summary.tpl to define the classes of stories.
    {if $pagename eq "story" || $pagename eq "submit"}
    <div class="stories-wide rounded" id="xnews-{$link_shakebox_index}">
    {elseif $pagename eq "user"}
    <div class="stories-user rounded" id="xnews-{$link_shakebox_index}">
    {elseif $pagename eq "index" || $pagename eq "published"}
    {if count($templatelite.get) == 0}
    {if $link_shakebox_index eq 0}
    <div class="stories1" id="xnews-0">
    {elseif $link_shakebox_index eq 1 || $link_shakebox_index eq 4}
    <div class="stories2" id="xnews-{$link_shakebox_index}">
    {elseif $link_shakebox_index eq 2}
    <br style="clear:both;" />
    <div class="stories3" id="xnews-{$link_shakebox_index}">
    {elseif $link_shakebox_index eq 3}
    <div class="stories4" id="xnews-{$link_shakebox_index}">
    {/if}
    {else}
    <div class="stories rounded" id="xnews-{$link_shakebox_index}">
    {/if}

    {else}
    <div class="stories rounded" id="xnews-{$link_shakebox_index}">
    {/if}
    What I'm trying to achieve if for my home page and each category to act as its own individual section. So when you are on the first page of each, the stories look a certain way and then when you go on to page 2 ect, the stories look different.

  10. #10
    Constant Pligger oobie11's Avatar
    Joined
    Apr 2009
    Posts
    148
    Thanks
    Received:1
    Given: 0
    ---bump---

Similar Threads

  1. Create New Page Variable for Page.php?
    By Jonase in forum Questions & Comments
    Replies: 12
    Last Post: 03-11-2010, 09:51 AM
  2. Page number in Title
    By israeliporn in forum Questions & Comments
    Replies: 2
    Last Post: 01-09-2010, 10:18 AM
  3. Problem with group's page (number of posts per page)
    By simosmme in forum Questions & Comments
    Replies: 4
    Last Post: 11-12-2009, 02:50 PM
  4. Replies: 6
    Last Post: 08-08-2007, 12:05 PM
  5. Number of Stories on the front page
    By thefirelane in forum Questions & Comments
    Replies: 1
    Last Post: 03-08-2006, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg