Page 1 of 1
News module: How to include "formatpostdate" in "Summary"?
Posted: Mon May 14, 2007 9:09 pm
by Joppjopp
Hello!
I would like to include the formatpostdate in the same paragraph as the summary. How do I do this? I also want to edit the formatpostdate so it looks like "(T&M 2007-05-14) instead of just "2007-05-14". How do I go about fixing that?
Regards
J
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Tue May 15, 2007 7:00 pm
by Joppjopp
I am not understanding something very basic here since no one is replying?
Anyone??
J
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Tue May 15, 2007 8:21 pm
by alby
Joppjopp wrote:
Hello!
I would like to include the formatpostdate in the same paragraph as the summary. How do I do this? I also want to edit the formatpostdate so it looks like "(T&M 2007-05-14) instead of just "2007-05-14". How do I go about fixing that?
In Content -> News -> Summary template:
Delete postdate section:
Code: Select all
{if $entry->formatpostdate}
<div class="NewsSummaryPostdate">
{$entry->formatpostdate}
</div>
{/if}
and in (Summary section):
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{/if}
add:
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{$entry->formatpostdate}
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{/if}
Call module:
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Tue May 15, 2007 9:50 pm
by Joppjopp
alby wrote:
Call module:
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby
Thanks! The above helped. But getting the formatpostdate in the end of the summary is still not working. I want it like this:
Alby, your examples lets me move the formatpostdate around, but it still won't join the text in the summary.
J
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Wed May 16, 2007 11:44 am
by alby
Joppjopp wrote:
alby wrote:
Call module:
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby
J
My test with:
{cms_module module="news" number="2" category="Home" dateformat="(T&M %Y-%m-%d)" moretext="dettaglio..."}
and
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
work well, see attach img
Alby
[gelöscht durch Administrator]
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Wed May 16, 2007 5:10 pm
by Joppjopp
Hi Alby. Thanks for all the help. It's still not working though I copied and pasted your code. My summary template looks like this:
Code: Select all
<!-- Start News Display Template -->
{foreach from=$items item=entry}
<div class="NewsSummary">
<div class="NewsSummaryTitle">
{$entry->title}
</div>
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
</div>
{/foreach}
<!-- End News Display Template -->
But my output looks like this:
Could it be something in the CSS?
Code: Select all
.NewsSummarySummary {
font-family: "Verdana", sans-serif;
font-size: 95%;
line-height: 1.5em;
color: #4A4A4A;
}
I am scratching my head. Not only is the date not added just after the word "styrelse", but both the date and the link are on the edge of the page, while they should be lining up with paragraph above...
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Wed May 16, 2007 8:00 pm
by alby
Joppjopp wrote:
But my output looks like this:
Could it be something in the CSS?
Code: Select all
.NewsSummarySummary {
font-family: "Verdana", sans-serif;
font-size: 95%;
line-height: 1.5em;
color: #4A4A4A;
}
I am scratching my head. Not only is the date not added just after the word "styrelse", but both the date and the link are on the edge of the page, while they should be lining up with paragraph above...
Look to html source page.
The problem, probably, is a paragraph of summary, ex:
Code: Select all
<div class="NewsSummarySummary">
<p>summary text</p>
(T&M 2007-05-21)
</div>
Try to drop html tag from summary with html source button in your WYSIWYG or select "none" in WYSIWYG field (User Preference)
and change (for link):
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Wed May 16, 2007 8:55 pm
by Joppjopp
alby wrote:
Look to html source page.
The problem, probably, is a paragraph of summary, ex:
Code: Select all
<div class="NewsSummarySummary">
<p>summary text</p>
(T&M 2007-05-21)
</div>
Try to drop html tag from summary with html source button in your WYSIWYG or select "none" in WYSIWYG field (User Preference)
Where would I look to find the HTML? (Or did I miss something here?)
Jesper
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Thu May 17, 2007 12:13 pm
by alby
Joppjopp wrote:
alby wrote:
Look to html source page.
The problem, probably, is a paragraph of summary, ex:
Code: Select all
<div class="NewsSummarySummary">
<p>summary text</p>
(T&M 2007-05-21)
</div>
Where would I look to find the HTML? (Or did I miss something here?)
Your browser: View page source or View HTML
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Thu May 17, 2007 9:01 pm
by Joppjopp
Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...
J
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Fri May 18, 2007 6:55 am
by alby
Joppjopp wrote:
Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...
Add date in summary text
Ok , for strip html tag (ex. p) in news article summary, you have two method:
1. Summary text only.
If you use TinyMCE, in last version, there is a option for display a button to turn wysiwyg on/off in textarea (in this case summary textarea). Turn off and edit your summary text. Result is text only.
Or, in User preferences, switch to "none" the field: Select WYSIWYG to use (Turn off all WYSIWYG textarea)
2. You know html tag.
In WYSIWYG of summary textarea (FCK or Tiny) there is a button for switch to html source. Strip p starting tag (and relative close tag), ex:
Code: Select all
<p> <----- start tag
qwerty <tag>qwerty</tag> qwerty qwerty qwerty qwerty
qwerty qwerty <tag>qwerty</tag> qwerty qwerty qwerty
</p> <---- end tag
Or hack action.editaricle.php (transform summary textarea in inputtext):
Code: Select all
Find the row:
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
and substitute with (note #):
$this->smarty->assign('inputsummary', $this->CreateInputText($id, 'summary', $summary, 75, 500));
# $this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Mon May 28, 2007 5:42 pm
by Joppjopp
Thanks Alby!
I'll try this. Sorry for not getting back to you on this sooner. I have been out of town.
J
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Sat Nov 03, 2007 11:15 pm
by Joppjopp
alby wrote:
Joppjopp wrote:
Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...
Add date in summary text
Ok , for strip html tag (ex. p) in news article summary, you have two method:
1. Summary text only.
If you use TinyMCE, in last version, there is a option for display a button to turn wysiwyg on/off in textarea (in this case summary textarea). Turn off and edit your summary text. Result is text only.
Or, in User preferences, switch to "none" the field: Select WYSIWYG to use (Turn off all WYSIWYG textarea)
2. You know html tag.
In WYSIWYG of summary textarea (FCK or Tiny) there is a button for switch to html source. Strip p starting tag (and relative close tag), ex:
Code: Select all
<p> <----- start tag
qwerty <tag>qwerty</tag> qwerty qwerty qwerty qwerty
qwerty qwerty <tag>qwerty</tag> qwerty qwerty qwerty
</p> <---- end tag
Or hack action.editaricle.php (transform summary textarea in inputtext):
Code: Select all
Find the row:
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
and substitute with (note #):
$this->smarty->assign('inputsummary', $this->CreateInputText($id, 'summary', $summary, 75, 500));
# $this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
Alby
Hi Alby!
I had to pause the project for a few months but now I am on it again. I've just tried what you suggest in the post above but it's not helping. If I erase the and it just looks like this (everything ends up in the marginal):
If I edit the code like you suggested nothing happens (that I can see anyway).

Any more ideas?
Jesper
Re: News module: How to include "formatpostdate" in "Summary"?
Posted: Sun Nov 04, 2007 2:11 am
by Dr.CSS
Then you need to add padding to div...