Browse Titles as a ...
 
Notifications
Clear all

Browse Titles as a simple list?

9 Posts
3 Users
0 Reactions
5,582 Views
(@guest1712)
Posts: 0
 

I'd like to be able to make a list of available stories appear when you browse, without listing the summary and what not. Just an unordered, bulleted list of all the titles.

But! I don't want to lose the ability to list titles with additional details as well.

The user should be able to browse to view a listing of titles as both a simple, plain, orindary, unordered, bulleted list (what Browse>>Categories looks like,) and then also be able to browse to view a listing of titles with the catagory, summary, classes, etc (what it already looks like.)

Ideas?


 
Posted : 11/01/2007 2:01 pm
 Kari
(@jayleesy)
Posts: 21
Eminent Member
 

This is very simple.
I did something similar with my new stories block.
What you need to do is create a new tpl with the format you want the stories to show up as (you can just edit storiesblock.tpl to suite your needs and give it another name, make sure you don't write over the stories block)
, then point the titles page to the new tpl.


 
Posted : 11/01/2007 8:06 pm
(@guest1712)
Posts: 0
 

storiesblock.tpl?

Can't find that. I have storiesblock.php and storyindex.tpl...

and how does one point the Browse function to the new template? You've lost me.

I thought I might need to add something new to the Browse folder


 
Posted : 11/01/2007 8:18 pm
(@tammy)
Posts: 2577
Member Moderator
 

You'll want to put a create a new file in the browse folder.  It's going to be more complicated than what jayleesy suggested, but he's on the right track.  Something like this:

You can copy the titles.php file as a place to start.  You'll want to delete this line:


$numrows = search(_STORYQUERY.$storyquery, _STORYCOUNT.$storyquery, "browse.php?");

This is completely off the top of my head and you'll have to debug it yourself.


        $numstories = dbquery(_STORYCOUNT.$storyquery);
        if($numstories > 0) {
            $storylist = "";
            $squery = dbquery(_STORYQUERY.$storyquery);
            while($s = dbassoc($squery)) {
                      $storylist .= title_link($s);
            }
            $tpl->assign("pagelinks", $storylist);
        }
          else {
                $tpl->assign("pagelinks", _NORESULTS);
        }

This has no pagination.  If you want that you'll need to add it.


 
Posted : 11/01/2007 11:59 pm
(@guest1712)
Posts: 0
 

hmmm, this exact code doesn't seem to be working, and I'm not sure why...


 
Posted : 12/01/2007 10:37 am
(@tammy)
Posts: 2577
Member Moderator
 

Turn debug on for your site and see if it'll give you an error.


 
Posted : 12/01/2007 11:14 am
(@guest1712)
Posts: 0
 

hrm. Nope, no errors.

http://rsveverka.com/ecity/browse.php?type=models

We've got the a-z and what not, and technically this is an attempt to make a list of an entirely different feild that I added, but just attempting it with titles (before customizing) does nothing.


 
Posted : 12/01/2007 11:52 am
(@tammy)
Posts: 2577
Member Moderator
 

Try adding at the top of the code I gave you:


      $tpl->newBlock("listings");

 
Posted : 12/01/2007 1:12 pm
(@guest1712)
Posts: 0
 

aha, that did something.

now to play with it, see if I can get it bulleted....


 
Posted : 12/01/2007 2:11 pm
Share: