News module: How to include "formatpostdate" in "Summary"?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
Joppjopp

News module: How to include "formatpostdate" in "Summary"?

Post 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
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post by Joppjopp »

I am not understanding something very basic here since no one is replying?  :'(

Anyone??

J
alby

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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:
Image

Alby, your examples lets me move the formatpostdate around, but it still won't join the text in the summary.
J
Last edited by Joppjopp on Tue May 15, 2007 10:02 pm, edited 1 time in total.
alby

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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]
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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:
Image

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...
alby

Re: News module: How to include "formatpostdate" in "Summary"?

Post by alby »

Joppjopp wrote:
But my output looks like this:
Image

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
Last edited by alby on Wed May 16, 2007 8:04 pm, edited 1 time in total.
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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
alby

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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
alby

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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  8)

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
Last edited by alby on Fri May 18, 2007 6:58 am, edited 1 time in total.
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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
Joppjopp

Re: News module: How to include "formatpostdate" in "Summary"?

Post 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  8)

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): Image

If I edit the code like you suggested nothing happens (that I can see anyway).  :(
Any more ideas?

Jesper
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News module: How to include "formatpostdate" in "Summary"?

Post by Dr.CSS »

Then you need to add padding to div...
Locked

Return to “Layout and Design (CSS & HTML)”