Removing part of the story from summary, but not from the complete story

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-28-2007, 02:57 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 205
I ma trying to make changes to the yget template link_summary.tpl page. I am trying to create a different layout and content than what is standard in the template. Ultimately, I want to have more limited information in the summary view and all in the full story view. The extra field are displayed by default, of which I only want 2 of the 15 in the summary. This is the code as it appears in the default yget template:

Quote:
{if $pagename eq "story"}{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}{if $pagename eq "story")<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}{/if}
I would like to only display only a few of the extra fields. However, I want ALL of the field to be displayed when the full story is viewed. I have added the following code (in green). {if $pagename eq "story"}{/if} , as in:

Quote:
{if $pagename eq "story"}{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}{if $pagename eq "story")<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}{/if}
This results in the following error. What am I doing wrong?

Quote:
Fatal error: TPL: [in yget/link_summary.tpl line 171]: syntax error: unidentified token 'br' (compile.compile_if.php, line 130) in /home/content/a/a/a/aaaaaaaaaaa1/html/class.template.php on line 923
Reply With Quote
  #2 (permalink)  
Old 12-28-2007, 04:06 PM
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Sep 2007
Posts: 192
I haven't tried this, but give it a try. Find these lines:

Code:
{if $viewtype neq "short"}
	<span class="news-body-text">
	<span id="ls_contents-{$link_shakebox_index}">
	{checkActionsTpl location="tpl_link_summary_pre_story_content"}
	{if $show_content neq 'FALSE'}
		{$story_content}
	{/if}
	{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
	{if $Enable_Extra_Field_2 eq 1}{if $link_field2 neq ""}<br/><b>{$Field_2_Title}:</b> {$link_field2}{/if}{/if}
	{if $Enable_Extra_Field_3 eq 1}{if $link_field3 neq ""}<br/><b>{$Field_3_Title}:</b> {$link_field3}{/if}{/if}
	{if $Enable_Extra_Field_4 eq 1}{if $link_field4 neq ""}<br/><b>{$Field_4_Title}:</b> {$link_field4}{/if}{/if}
	{if $Enable_Extra_Field_5 eq 1}{if $link_field5 neq ""}<br/><b>{$Field_5_Title}:</b> {$link_field5}{/if}{/if}
	{if $Enable_Extra_Field_6 eq 1}{if $link_field6 neq ""}<br/><b>{$Field_6_Title}:</b> {$link_field6}{/if}{/if}
	{if $Enable_Extra_Field_7 eq 1}{if $link_field7 neq ""}<br/><b>{$Field_7_Title}:</b> {$link_field7}{/if}{/if}
	{if $Enable_Extra_Field_8 eq 1}{if $link_field8 neq ""}<br/><b>{$Field_8_Title}:</b> {$link_field8}{/if}{/if}
	{if $Enable_Extra_Field_9 eq 1}{if $link_field9 neq ""}<br/><b>{$Field_9_Title}:</b> {$link_field9}{/if}{/if}
	{if $Enable_Extra_Field_10 eq 1}{if $link_field10 neq ""}<br/><b>{$Field_10_Title}:</b> {$link_field10}{/if}{/if}
	{if $Enable_Extra_Field_11 eq 1}{if $link_field11 neq ""}<br/><b>{$Field_11_Title}:</b> {$link_field11}{/if}{/if}
	{if $Enable_Extra_Field_12 eq 1}{if $link_field12 neq ""}<br/><b>{$Field_12_Title}:</b> {$link_field12}{/if}{/if}
	{if $Enable_Extra_Field_13 eq 1}{if $link_field13 neq ""}<br/><b>{$Field_13_Title}:</b> {$link_field13}{/if}{/if}
	{if $Enable_Extra_Field_14 eq 1}{if $link_field14 neq ""}<br/><b>{$Field_14_Title}:</b> {$link_field14}{/if}{/if}
	{if $Enable_Extra_Field_15 eq 1}{if $link_field15 neq ""}<br/><b>{$Field_15_Title}:</b> {$link_field15}{/if}{/if} 		  			
	{if $pagename neq "story"} <a href="{$story_url}">{#PLIGG_Visual_Read_More#}</a> &raquo; {/if}<br /> 
	</span>
	</span>
{/if}
Replace with:

Code:
{if $viewtype eq "short"}
	<span class="news-body-text">
	<span id="ls_contents-{$link_shakebox_index}">
	{checkActionsTpl location="tpl_link_summary_pre_story_content"}
	{if $show_content neq 'FALSE'}
		{$story_content}
	{/if}
	{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
	{if $Enable_Extra_Field_2 eq 1}{if $link_field2 neq ""}<br/><b>{$Field_2_Title}:</b> {$link_field2}{/if}{/if}		  			
	{if $pagename neq "story"} <a href="{$story_url}">{#PLIGG_Visual_Read_More#}</a> &raquo; {/if}<br /> 
	</span>
	</span>
    {elseif $viewtype neq "short"}
	<span class="news-body-text">
	<span id="ls_contents-{$link_shakebox_index}">
	{checkActionsTpl location="tpl_link_summary_pre_story_content"}
	{if $show_content neq 'FALSE'}
		{$story_content}
	{/if}
	{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
	{if $Enable_Extra_Field_2 eq 1}{if $link_field2 neq ""}<br/><b>{$Field_2_Title}:</b> {$link_field2}{/if}{/if}
	{if $Enable_Extra_Field_3 eq 1}{if $link_field3 neq ""}<br/><b>{$Field_3_Title}:</b> {$link_field3}{/if}{/if}
	{if $Enable_Extra_Field_4 eq 1}{if $link_field4 neq ""}<br/><b>{$Field_4_Title}:</b> {$link_field4}{/if}{/if}
	{if $Enable_Extra_Field_5 eq 1}{if $link_field5 neq ""}<br/><b>{$Field_5_Title}:</b> {$link_field5}{/if}{/if}
	{if $Enable_Extra_Field_6 eq 1}{if $link_field6 neq ""}<br/><b>{$Field_6_Title}:</b> {$link_field6}{/if}{/if}
	{if $Enable_Extra_Field_7 eq 1}{if $link_field7 neq ""}<br/><b>{$Field_7_Title}:</b> {$link_field7}{/if}{/if}
	{if $Enable_Extra_Field_8 eq 1}{if $link_field8 neq ""}<br/><b>{$Field_8_Title}:</b> {$link_field8}{/if}{/if}
	{if $Enable_Extra_Field_9 eq 1}{if $link_field9 neq ""}<br/><b>{$Field_9_Title}:</b> {$link_field9}{/if}{/if}
	{if $Enable_Extra_Field_10 eq 1}{if $link_field10 neq ""}<br/><b>{$Field_10_Title}:</b> {$link_field10}{/if}{/if}
	{if $Enable_Extra_Field_11 eq 1}{if $link_field11 neq ""}<br/><b>{$Field_11_Title}:</b> {$link_field11}{/if}{/if}
	{if $Enable_Extra_Field_12 eq 1}{if $link_field12 neq ""}<br/><b>{$Field_12_Title}:</b> {$link_field12}{/if}{/if}
	{if $Enable_Extra_Field_13 eq 1}{if $link_field13 neq ""}<br/><b>{$Field_13_Title}:</b> {$link_field13}{/if}{/if}
	{if $Enable_Extra_Field_14 eq 1}{if $link_field14 neq ""}<br/><b>{$Field_14_Title}:</b> {$link_field14}{/if}{/if}
	{if $Enable_Extra_Field_15 eq 1}{if $link_field15 neq ""}<br/><b>{$Field_15_Title}:</b> {$link_field15}{/if}{/if} 		  			
	{if $pagename neq "story"} <a href="{$story_url}">{#PLIGG_Visual_Read_More#}</a> &raquo; {/if}<br /> 
	</span>
	</span>
{/if}
I have no idea if this would work, because I don't really understand what the "short" stands for. But if it does stand for the difference between story mode and summary mode, then it rather makes sense to me to change it to what I have to achieve your results. Because the first statement is asking if in summary mode then show only two fields -- or -- else if in story mode, then show all 15 fields.

Last edited by blaze; 12-28-2007 at 04:14 PM.
Reply With Quote
  #3 (permalink)  
Old 12-28-2007, 05:29 PM
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Sep 2007
Posts: 192
Yes, it makes sense and you are on the right track. However, in addition to that, what I did was add {if} and {else} statements to the sidebar modules. For me, it wasn't necessary to show them ALL on every page. By reducing the number of modules for the other pages, you also change the "weight" of the template versus main content area in regards to text. This way, you're sure not to have duplicate content because the main content area will likely have more than 100% of wording than the sidebars, header and footer combined in story mode, even if the full story isn't that much more text than the summary itself.

Basically, if you know how to write {if} statements and use them wisely, there really is no excuse for you to have duplicate content on your site EVEN IF IT'S DUPLICATE, mathematically speaking, of course. I think this is the advantage of watching those videos -- we learn that Search Engines really don't read the content like human beings, instead they only analyze the content and formulate its duplication estimate based upon the number of characters, words and repeated phrases the content contains to other content on your site. Being 100% in "weight" for the amount of words used in the main content area as opposed to the template area is actually a high number, but by using this measure, you're definitely safe.

For example, here's what my sidebar.tpl looks like:

Code:
{config_load file="/libs/lang.conf"}
{if $pagename eq "published"}
{if $user_authenticated ne true} {* show only if NOT logged in *}
	{assign var=sidebar_module value="about_box"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{/if}
{checkActionsTpl location="tpl_sidebar_top"} 
{assign var=sidebar_module value="rss-feeds"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{assign var=sidebar_module value="categories"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{assign var=sidebar_module value="sidebar_stories_u"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{assign var=sidebar_module value="sidebar_stories"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}

{elseif $pagename eq "upcoming"}
{if $user_authenticated ne true} {* show only if NOT logged in *}
	{assign var=sidebar_module value="about_box"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{/if}
{checkActionsTpl location="tpl_sidebar_top"} 
{assign var=sidebar_module value="rss-feeds"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{assign var=sidebar_module value="categories"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}

{elseif $pagename eq "story"}
{checkActionsTpl location="tpl_sidebar_top"} 

{else}
{if $user_authenticated ne true} {* show only if NOT logged in *}
	{assign var=sidebar_module value="about_box"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{/if}
{checkActionsTpl location="tpl_sidebar_top"} 
{assign var=sidebar_module value="rss-feeds"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
{/if}
Of course, your modules may vary because I have some different ones, but you get the idea for what I am talking about.
Reply With Quote
  #4 (permalink)  
Old 12-28-2007, 06:30 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 205
Initially, I thought this was the correct solution, however, when I went to the complete story, it showed only the extra fields that were displayed in the summary post. I think I need to get the {elseif} located properly. Which is the reason I deleted the reply post. But, if fell like I am on the correct tract. I will post the final version, if I can sort it out.

Thanks for the sidebar code, that will be the next thing I will look at.
Reply With Quote
  #5 (permalink)  
Old 12-28-2007, 06:46 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 205
This may be the problem. In the story_center.tpl this is how the full story is displayed. I tried changing out this code, with no success.

Quote:
{php}
Global $db, $main_smarty, $link;
$link->print_summary();
{/php}
Reply With Quote
  #6 (permalink)  
Old 12-28-2007, 07:16 PM
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Sep 2007
Posts: 192
Try this instead. I am now using an {else} statement instead of {elseif}. This might solve the problem.

Code:
{if $viewtype eq "short"}
	<span class="news-body-text">
	<span id="ls_contents-{$link_shakebox_index}">
	{checkActionsTpl location="tpl_link_summary_pre_story_content"}
	{if $show_content neq 'FALSE'}
		{$story_content}
	{/if}
	{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
	{if $Enable_Extra_Field_2 eq 1}{if $link_field2 neq ""}<br/><b>{$Field_2_Title}:</b> {$link_field2}{/if}{/if}		  			
	{if $pagename neq "story"} <a href="{$story_url}">{#PLIGG_Visual_Read_More#}</a> &raquo; {/if}<br /> 
	</span>
	</span>
    {else}
	<span class="news-body-text">
	<span id="ls_contents-{$link_shakebox_index}">
	{checkActionsTpl location="tpl_link_summary_pre_story_content"}
	{if $show_content neq 'FALSE'}
		{$story_content}
	{/if}
	{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}
	{if $Enable_Extra_Field_2 eq 1}{if $link_field2 neq ""}<br/><b>{$Field_2_Title}:</b> {$link_field2}{/if}{/if}
	{if $Enable_Extra_Field_3 eq 1}{if $link_field3 neq ""}<br/><b>{$Field_3_Title}:</b> {$link_field3}{/if}{/if}
	{if $Enable_Extra_Field_4 eq 1}{if $link_field4 neq ""}<br/><b>{$Field_4_Title}:</b> {$link_field4}{/if}{/if}
	{if $Enable_Extra_Field_5 eq 1}{if $link_field5 neq ""}<br/><b>{$Field_5_Title}:</b> {$link_field5}{/if}{/if}
	{if $Enable_Extra_Field_6 eq 1}{if $link_field6 neq ""}<br/><b>{$Field_6_Title}:</b> {$link_field6}{/if}{/if}
	{if $Enable_Extra_Field_7 eq 1}{if $link_field7 neq ""}<br/><b>{$Field_7_Title}:</b> {$link_field7}{/if}{/if}
	{if $Enable_Extra_Field_8 eq 1}{if $link_field8 neq ""}<br/><b>{$Field_8_Title}:</b> {$link_field8}{/if}{/if}
	{if $Enable_Extra_Field_9 eq 1}{if $link_field9 neq ""}<br/><b>{$Field_9_Title}:</b> {$link_field9}{/if}{/if}
	{if $Enable_Extra_Field_10 eq 1}{if $link_field10 neq ""}<br/><b>{$Field_10_Title}:</b> {$link_field10}{/if}{/if}
	{if $Enable_Extra_Field_11 eq 1}{if $link_field11 neq ""}<br/><b>{$Field_11_Title}:</b> {$link_field11}{/if}{/if}
	{if $Enable_Extra_Field_12 eq 1}{if $link_field12 neq ""}<br/><b>{$Field_12_Title}:</b> {$link_field12}{/if}{/if}
	{if $Enable_Extra_Field_13 eq 1}{if $link_field13 neq ""}<br/><b>{$Field_13_Title}:</b> {$link_field13}{/if}{/if}
	{if $Enable_Extra_Field_14 eq 1}{if $link_field14 neq ""}<br/><b>{$Field_14_Title}:</b> {$link_field14}{/if}{/if}
	{if $Enable_Extra_Field_15 eq 1}{if $link_field15 neq ""}<br/><b>{$Field_15_Title}:</b> {$link_field15}{/if}{/if} 		  			
	{if $pagename neq "story"} <a href="{$story_url}">{#PLIGG_Visual_Read_More#}</a> &raquo; {/if}<br /> 
	</span>
	</span>
{/if}
Reply With Quote
  #7 (permalink)  
Old 12-28-2007, 08:10 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 205
Yes ... I tried that on my own. And I tried two {if} statements as well. No luck.

But, for good measure, I tried your code above, also with no luck.

The only thing I can think is that there is some connection to the "print_summary" since that is the only way the summary story gets info the full story. I may try to take a look at some of the other free templates, maybe they have this coded differently.
Reply With Quote
  #8 (permalink)  
Old 12-28-2007, 08:26 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 205
I have tried multiple combinations of the {if}, {else} and {elseif} statements. Here is what I have discovered ....

The statement {if $viewtype neq "short"} is the only one that works.

The statement {if $viewtype eq "short"} does not work.

In fact, it will show both the shortened three extra fields and the total fifteen if I use the statement {if $viewtype neq "short"}.
Reply With Quote
  #9 (permalink)  
Old 12-28-2007, 09:15 PM
wwwSENSERELYcom's Avatar
Casual Pligger
 
Join Date: May 2007
Location: Tianjin, China
Posts: 67
Just jumping in quickly, without reading the whole things, notice that you have a syntax error on this line :
Quote:
{if $pagename eq "story"}{if $Enable_Extra_Field_1 eq 1}{if $link_field1 neq ""}{if $pagename eq "story")<br/><b>{$Field_1_Title}:</b> {$link_field1}{/if}{/if}{/if}
You ended the second if $pagename eq "story" with a ) when it should be a }

Also, I don't know what you have after this code, but when you open 4 if you should have 4 /if to close them
Reply With Quote
  #10 (permalink)  
Old 12-29-2007, 12:13 AM
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Sep 2007
Posts: 192
Quote:
Originally Posted by not2serious View Post
I have tried multiple combinations of the {if}, {else} and {elseif} statements. Here is what I have discovered ....

The statement {if $viewtype neq "short"} is the only one that works.

The statement {if $viewtype eq "short"} does not work.

In fact, it will show both the shortened three extra fields and the total fifteen if I use the statement {if $viewtype neq "short"}.
{if $viewtype neq "short"} is actually the real code -- but again, I have no idea what the "short" actually refers to. I thought it meant short as in "short story" or "summary". This is why I changed it to eq rather than keep it as neq, meaning if the "short" or "summary" equals blah blah, then do this or that.

I don't think the print function really has anything to do with this. We need to find the variable that seperates the summary from the actual story, then you can write your {if} {else} statements correctly.

Does anyone else know what the variable for the summary is?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Complete solution to approve the story after being submitted redwine Questions and Comments 39 06-18-2009 02:39 PM
In story page, only summary shown observer_24_7 Questions and Comments 7 06-25-2008 08:53 PM
summary of story in complete story-view gatekeeper Questions and Comments 1 04-18-2008 04:31 PM
How to direct story title in summary page to the original story? chris79 Questions and Comments 4 02-03-2008 07:28 PM
How do I change the story summary Romac Questions and Comments 1 01-20-2008 01:04 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development