Page 1 of 1
Headlines
Posted: Thu Dec 16, 2004 6:29 am
by notset4life
Is there a way to display headlines only?
I have categories set up, and I would like the user to click a category link and see only the headlines come up, not the entire articles.
Thanks
Posted: Thu Dec 16, 2004 9:52 am
by tadpole
0.7 or 0.8? In 0.8 it's easy, you just modify the entries.tpl file. In 0.7, well the easiest way would probably be to use CSS (display: none) to hide certain elements, but note that they would still be sent to the client. Other than that, you'd have to modify quite a bit of the code.
Posted: Thu Dec 16, 2004 5:22 pm
by Guest
Thanks...I have the latest version (08 something)
and can't find the entries.tpl file.
Also, upgrading seemed to confuse things a little....there are a lot
less files in the serendipity root directory that there were before...were
these moved to "deployment?"
Posted: Mon Dec 20, 2004 4:20 pm
by garvinhicking
The entries.tpl file can be found in templates/default/entries.tpl.
And yes, we moved quite a few files to the 'include' subdirectory tree - all those files no longer need to swamp the document root
Regards,
Garvin
Posted: Mon Dec 20, 2004 8:42 pm
by Guest
I found the entries.tpl file, but I have no idea how to edit it and don't know if that's what I'm really looking to do.
Here is my site:
http://www.cybermidi.com/default.php
I have the news on the front page as I want it. All I am looking for
are links to CATEGORIES to put on the left hand side of the screen.
I already have them there, but when they are clicked, they bring up
all the stories in the category. I just want them to bring up a page with just clickable headlines to each story. Can this be done?
thanks again.
Posted: Tue Dec 21, 2004 12:55 pm
by garvinhicking
Yes, it can be done - but you need a bit knowledge of simple comparison logic and some basic HTML; some PHP would also help in the process of creating it.
Serendipity is prepared to let you edit all the HTML code and also introduce new logic to switch whether to display content or headlines or whatever; but you need to do some "if" clauses to show the parts of HTML that you need.
For instance you could edit your entries.tpl file like this. Old code:
Code: Select all
<div class="serendipity_entry_body">
{$entry.body}
</div>
{if $entry.is_extended}
<div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if}
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<br /><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a><br /><br />
{/if}
New code:
Code: Select all
{if (not $is_single_entry && !preg_match('@/categories@', $smarty.server.REQUEST_URI))}
<div class="serendipity_entry_body">
{$entry.body}
</div>
{if $entry.is_extended}
<div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if}
{if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
<br /><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a><br /><br />
{/if}
{/if}
Notice the first line which queries if you are in category view. NOTICE: For this to work you need to disable your Smarty Security mode! Edit the file include/functions_smarty.inc.php, search for
Code: Select all
$serendipity['smarty']->security = true;
and change it to:
Code: Select all
$serendipity['smarty']->security = false;
Since your page is commercial and your question rather specific to your installation, I cannot give you further free advice; if you need more help to set it up, just contact me and I am sure we can work something out. I'm interested in MIDI-files.
Regards,
Garvin.