• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: CGBlog - A several of things
PostPosted: Tue Nov 24, 2009 3:40 am 
Offline
Forum Members
Forum Members

Joined: Wed Dec 31, 2008 9:16 pm
Posts: 24
- How do I have the blog entry's title in the HTML Meta title tag?

- Is there search module for CGBlog?

- Comments - Use CGFeedback? Can I show how many comments made on summary page?

Ie. Nov 23, 2009 | Posted in General, Video Blog | 3 Comment(s)

- What module to use to share the blog via twitter, facebook, email, etc... ?

Thanks!


Last edited by phreerider on Tue Nov 24, 2009 5:22 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Tue Nov 24, 2009 11:13 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
Quote:
- How do I have the blog entry's title in the HTML Meta title tag?

1. You have to specify witch page will show blog entries in detail mode (you can create one just for this purpose).  Lets call it "blog_details".
2. Open page "blog_details" and paste "" in "Page Specific Metadata:"
(3.) To make sure page is displaying Blog entry in detail mode you can create UDT that checks $_GET variable for url parameter "mact" and searches substrings "CGBlog" and "detai" in it's value.

Quote:
- Is there search module for CGBlog?

CGBlog is searchable by built in search module.

Quote:
- Comments - Use CGFeedback? Can I show how many comments made on summary page?

thats right - use CGFeedback.

1. In CGBlog summary template after each summary i added link to comment form (just below blog record in detail page)
Code:
<a href="{$entry->detail_url}#cgblog_comment" title="comment it">Comment it {assign var='temp' value=$entry}
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' summarytemplate='counter' lang=$lang}
{assign var='entry' value=$temp}</a>


2. Place anchor "#cgblog_comment" to jump to comment section in CGBlog detail template

3. Anchor and CGFeedback tags in blog detail template:
Code:
<div class='paragraph'>
<a name='cgblog_comment'/>
{startExpandCollapse id="cgblog_comment" title="Add Comment"}
{CGFeedback key1="CGBlog" key2=$entry->id inline=0 lang=$lang}
{stopExpandCollapse}
</div>

{assign var='temp' value=$entry}
<div class='paragraph'>
{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate='blog_summary' lang=$lang}
</div>
{assign var='entry' value=$temp}

{assign var='temp' value=$entry}
<div class='paragraph'>
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' summarytemplate='blog_summary' lang=$lang}
</div>
{assign var='entry' value=$temp}

   a. "
" is specific to my style,
   b. "{startExpandCollapse id="cgblog_comment" title="Add Comment"}" and "{stopExpandCollapse}" makes comment form collapsable.
   c. "{assign var='temp' value=$entry}" "{assign var='temp' value=$entry}" prevents variable {$entry} from being overwritten.
   d. "ratingstemplate='blog_summary'" and "summarytemplate='blog_summary'" adjusted to particular layout of my page.

4. Create "summarytemplate='counter'" to display number of comments nextto link "Comment it" in brackets "(" and ")". If no comments displays nothing.
Code:
{if !empty($comments)}
{foreach from=$comments name='temp_counter' item='temp'} 
{/foreach}
({$smarty.foreach.temp_counter.total})
{/if}


Quote:
- What module to use to share the blog via twitter, facebook, email, etc... ?

Download tag "SocialBookmarking" from http://dev.cmsmadesimple.org/projects/socialbks

Have a nice day. :)

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Tue Nov 24, 2009 5:58 pm 
Offline
Forum Members
Forum Members

Joined: Wed Dec 31, 2008 9:16 pm
Posts: 24
Thank you!

Good karma coming your way soon :)

Cheers,
Colin


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Nov 26, 2009 10:42 am 
Offline
Forum Members
Forum Members

Joined: Wed Dec 31, 2008 9:16 pm
Posts: 24
I've tested it... all good except one thing, the counter number are repeating for every blog entries on the summary page.

ie.

Blog Title #1

Summary

Nov 26, 2009 | Comment it (3)

--

Blog Title #2

Summary

Nov 25, 2009 | Comment it (3)

--

Blog Title #3

Summary

Nov 21, 2009 | Comment it (3)

--

Any idea how to fix it? Thanks.


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Nov 26, 2009 12:33 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
I think it is just mater of placing thing to the right place.
Post CGBlog summary and detail templates you have created.

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Nov 26, 2009 10:38 pm 
Offline
Forum Members
Forum Members

Joined: Wed Dec 31, 2008 9:16 pm
Posts: 24
Ok, here is the code:

Summary:
Code:
<!-- Start CGBlog Display Template -->

{foreach from=$items item=entry}
<div class="CGBlogSummary">



<div class="CGBlogSummaryLink">
<h2 class="blog-link"><a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}"  class="blog-link">{$entry->title|escape}</a></h2>
</div>


{if $entry->summary}
   <div class="CGBlogSummarySummary">
      {eval var=$entry->summary}
   </div>

{else if $entry->content}

   <div class="CGBlogSummaryContent">
      {eval var=$entry->content}
   </div>
{/if}
<p style="margin-bottom: 30px;"><a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}"  class="external">Read more...</a></p>
<div style="font-size: 10px; border-bottom:1px dotted #363636; margin-bottom: 30px; padding-bottom: 10px; margin-top: 30px;">
{if $entry->postdate}
      {$entry->postdate|cms_date_format} | <!-- AddThis Button BEGIN -->
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&pub=xa-4b0e3f8a04ddb216">Share</a> | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4b0e3f8a04ddb216"></script>
<!-- AddThis Button END -->
{/if}
<a href="{$entry->detail_url}#cgblog_comment" title="comment it">Comment it {assign var='temp' value=$entry}
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' summarytemplate='counter' lang=$lang}
{assign var='entry' value=$temp}</a>
{if !empty($comments)}
{foreach from=$comments name='temp_counter' item='temp'} 
{/foreach}
({$smarty.foreach.temp_counter.total})
{/if}
</div>


{if isset($entry->extra)}
    <div class="CGBlogSummaryExtra">
        {eval var=$entry->extra}
   {* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
    </div>
{/if}
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="CGBlogSummaryField">
        {if $field->type == 'file'}
          <img src="{$entry->file_location}/{$field->value}"/>
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
     </div>
  {/foreach}
{/if}

</div>
{/foreach}

{if $pagecount > 1}
  <p>
{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}
</p>
{/if}
<!-- End CGBlog Display Template -->


Detail:
Code:
{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
  {assign var='canonical' value=$entry->canonical}
{/if}

{if $entry->postdate}

{/if}
<h1 style="margin-top: 0px; margin-bottom: 40px;">{$entry->title|escape}</h1>


<div id="CGBlogPostDetailContent">
   {eval var=$entry->content}
</div>

{if $entry->extra}
   <div id="CGBlogPostDetailExtra">
      {$extra_label} {$entry->extra}
   </div>
{/if}

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="CGBlogDetailField">
        {if $field->type == 'file'}
     {* this template assumes that every file uploaded is an image of some sort, because CGBlog doesn't distinguish *}
          <img src="{$entry->file_location}/{$field->value}"/>
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
     </div>
  {/foreach}
{/if}

<div style="border-bottom:0px dotted #363636; margin-bottom: 30px; padding-bottom: 10px; margin-top: 30px; font-size: 10px;">
{if $entry->postdate}
      {$entry->postdate|cms_date_format} | <!-- AddThis Button BEGIN -->
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&pub=xa-4b0e3f8a04ddb216">Share</a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4b0e3f8a04ddb216"></script>
<!-- AddThis Button END -->
{/if}

</div>

<div class='paragraph'>
<a name='cgblog_comment'></a>
{startExpandCollapse id="cgblog_comment" title="Add Comment"}
{CGFeedback key1="CGBlog" key2=$entry->id inline=0 lang=$lang}
{stopExpandCollapse}
</div>

{assign var='temp' value=$entry}
<div class='paragraph'>
{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate='blog_summary' lang=$lang}
</div>
{assign var='entry' value=$temp}

{assign var='temp' value=$entry}
<div class='paragraph'>
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' summarytemplate='blog_summary' lang=$lang}
</div>
{assign var='entry' value=$temp}



Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Nov 26, 2009 11:29 pm 
Offline
Forum Members
Forum Members

Joined: Wed Dec 31, 2008 9:16 pm
Posts: 24
One more thing - Can I do the recent comments with CGFeedback too? Thanks


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Fri Nov 27, 2009 10:19 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
Quote:


{foreach from=$items item=entry}







{if $entry->summary}

{eval var=$entry->summary}


{else if $entry->content}


{eval var=$entry->content}

{/if}

Read more...



{if $entry->postdate}
{$entry->postdate|cms_date_format} |
Share |

{/if}
Comment it {assign var='temp' value=$entry}
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' summarytemplate='counter' lang=$lang}
{assign var='entry' value=$temp}

{if !empty($comments)}
{foreach from=$comments name='temp_counter' item='temp'} 
{/foreach}
({$smarty.foreach.temp_counter.total})
{/if}




{if isset($entry->extra)}
   

        {eval var=$entry->extra}
{* {cms_module module='Uploads' mode='simpleurl' upload_id=$entry->extravalue} *}
   

{/if}
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     

        {if $field->type == 'file'}
         
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
     

  {/foreach}
{/if}


{/foreach}

{if $pagecount > 1}
 


{if $pagenumber > 1}
{$firstpage} {$prevpage}
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
{$nextpage} {$lastpage}
{/if}


{/if}


Red part should be in in CGFeedback summarytemplate ("counter"). You need 2 summary templates for CGFeedback:
1. To display comments (e.g. "Sample")
2. To count comments for an blog entry ("counter")

Variable {$comments} is assigned to proper value only in CGFeedback templates, outside - last known values is used.


Quote:
One more thing - Can I do the recent comments with CGFeedback too? Thanks

Sure. Lets say you want visible 11 recent comments :
1. call tag {CGFeedback key1="CGBlog"  action='summary' pagelimit=11   summarytemplate='recent_comments'}
   by default feedback is sorted by create date and in descending order so it is not necessary to add params:
      a. sortby="created"
      b. sortorder="DESC"
2. Create new feedback template "recent_comments". Basically you just need to delete pagination part in new template
Code:
{if $pagecount > 1}
<p>
  {if $pagenum > 1}
    <a href="{$firstpage_url}" title="{$mod->Lang('lbl_goto_firstpage')}"><<</a> 
    <a href="{$prevpage_url}" title="{$mod->Lang('lbl_goto_prevpage')}"><</a> 
  {/if}
  {$mod->Lang('lbl_page')} {$pagenum} {$mod->Lang('lbl_of')} {$pagecount}
  {if $pagenum < $pagecount}
     <a href="{$nextpage_url}" title="{$mod->Lang('lbl_goto_nextpage')}">></a> 
    <a href="{$lastpage_url}" title="{$mod->Lang('lbl_goto_lastpage')}">>></a>
  {/if}
</p>
{* pagecount *}{/if}

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Wed Jul 28, 2010 11:45 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Mon Feb 06, 2006 6:06 pm
Posts: 133
Location: Vancouver, Canada
Hi:

Sorry for re-opening this post.  I followed your instructions exactly.  I seem to have this error:
Notice: Undefined variable: showall in ...../modules/CGFeedback/action.ratings.php on line 79
I'm using cmsms v1.8 with
CGBlog 1.4
CGExtensions 1.19.1
CGFeedback 1.2
CGSimpleSmarty 1.4.5

Any ideas if this is related to the error i now have in Captcha v0.4.2
Notice: Undefined variable: selectedindex in ...../modules/Captcha/lib/classes/module/class.captcha.php on line 785

thanks again for your help, Peciura.

_________________
thank you

KP


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Jul 29, 2010 8:17 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Mon Feb 06, 2006 6:06 pm
Posts: 133
Location: Vancouver, Canada
never mind fixed it.  there was some google analytics that were not liberalized.  My mistake.

_________________
thank you

KP


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Thu Jul 29, 2010 10:19 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Mon Feb 06, 2006 6:06 pm
Posts: 133
Location: Vancouver, Canada
Quick question.  if i wanted to remove the rating system and simplify the comment section, is it best to apply display: none; in the stylesheet or to remove it from the template?  if the latter, how do I do this?  the site I'm working on is http://keepsakefamilytreevideo.com/newsite/index.php?mact=CGBlog,cntnt01,detail,0&cntnt01articleid=1&cntnt01detailtemplate=KFLV&cntnt01returnid=62

if it looks awful in IE, let me know.  I usually tackle IE last  ;D

_________________
thank you

KP


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Fri Jul 30, 2010 6:20 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
Delete rating field from CGFeedBack form
Code:
  <div class="row" style="margin: 1em;">
    <div class="col30" style="float: left; width: 29%;">
      {$mod->Lang('prompt_your_rating')}:
    </div>
    <div class="col70" style="float: left; width: 70%;">
      <select name="{$actionid}rating">
        {html_options options=$rating_options selected=$rating}
      </select>
    </div>
  </div>
  <div class="clearfix"></div>


and remove rating report from summary ( and detail template if you use it)
Code:
    <div class="feedback_item_rating">
      {$mod->Lang('lbl_rating')}: {$one.rating}  
      {section name='rating' start=1 loop=6}
        {if $smarty.section.rating.index <= $one.rating}
          <img src="{$rating_imgs.img_on}" alt=""/>
        {else}
          <img src="{$rating_imgs.img_off}" alt=""/>
        {/if}
      {/section}
    </div>

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Fri Jul 30, 2010 7:29 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Mon Feb 06, 2006 6:06 pm
Posts: 133
Location: Vancouver, Canada
Sweet.  that's great!

one last itsy bitsy thing.  i'm adding the return link at the bottom of the detail feedback template, but it's not working.  I thought we were able to do this according to the Help.

code added is:
Code:
{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url}{if $category_name != ''} - {$category_link}{/if}</div>
{/if}


Any ideas?

_________________
thank you

KP


Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things. AGAIN!
PostPosted: Sat Sep 18, 2010 10:02 pm 
Offline
New Member

Joined: Sun May 02, 2010 2:21 pm
Posts: 9
Hi, sorry, I gotta re-open the discussion, because I'm interested in some things:
 1. How can I maintain pagenation per category when I browse them??? Is that possible, because
 it is not working, only on the main page of blog entries.
  (SOLVED:  just added pagelimit to browsecat mode) :D

 2. How can I show(include) empty categories in category list (browsecat mode)?  

 3. Is it possible to integrate a CGCalendar in CGBlog, or any calendar, I mean create links per date numbers in each months?
 
 4. I need pagination like this "Pages: 1. 2. 3. 4. >  >>". Has someone done this one already??

Appriciate any help :)


Last edited by hoodedman on Sat Sep 18, 2010 10:20 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: CGBlog - A several of things
PostPosted: Fri Sep 24, 2010 12:23 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
3. It can be done with a single UDT
4. I have done somewat similar pagination for Products and "ugly url" You can easily adopt it to any module http://forum.cmsmadesimple.org/index.ph ... #msg223502

If you need more help post summary template and link to your page.

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Last edited by Peciura on Sun Sep 26, 2010 8:06 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner