Page 1 of 2

CGBlog - Help needed - A couple of things

Posted: Mon Oct 19, 2009 10:46 am
by katea
Hey guys,

Sorry for the repost. I originally oput this in the general discussion ... Sorry ....

Admin, please can you delete the post in General Diiscussion with the same name? Thanks

Hi guys,

I've opted for CGBlog instead of the blogs made simple, but there are a couple of things I'm having trouble with regarding linking pages to each other.

1) Categories don't seem to be showing ... This could be me being silly.. I have general as the defailt and 3 other blog categories along with it .... I just figured that the other 3 categories would become part of the general and link to each other accordingly.

Yep, me being silly inserted

Code: Select all

{CGBlog action="browsecat"}
at the bottom of my page and I have the categories.

2) In the summary page, which shows the blog entries lovely. It shows me what category the blog entry is in, but I'd like that to be a link to that category, and for that page to show all the blog entries for that ategory, much like the summary page does.

Thought this might work, but alas no:

Code: Select all

<a href="{$category}" title="{$category.name}">{$category.name}</a>
I can get yto a particular post using:

Code: Select all

<a href="{$entry->detail_url}" title="{$category.name}">{$category.name}</a>
But all the variations i've tried:

Code: Select all

{$entry->category_url}, {$entry->category.url}, {$entry->categories}, {$entry->category}
And so on, just don't seem to work ...


3)  On each details template I'd like a RETURN link ... Going back to the summary or category

4) Tried placing the breadcumbs in, but they don't seem to work.


All these functions are already active in BlogsMadeSimple ... But in CGBlogs it seems to be a nightmare to get them to work. I've tried copying some of the code from the other blogs, but I can't seem to get them to work.

Someone please help me!! ;o)

Re: CGBlog - Help needed - A couple of things

Posted: Thu Oct 22, 2009 3:41 am
by jab
Just curious, why did you decide against using Blogs Made Simple if things worked there? It also supports comments without all the overhead of the comments module that you would have to use with (CGBlog). The RSS by category is also nice. So, I'm really interested in knowing why you didn't use BMS. Sorry, I can't help wiht CGB.

Jab

Re: CGBlog - Help needed - A couple of things

Posted: Thu Oct 22, 2009 8:59 am
by Peciura
I think it is simple to decide after you read description of BMS :
Note! This module will most likely be discontinued as CGBlog is far better maintained and internally structured... If starting from scratch, please use that instead of this module! Previous description: An advanced, but easytouse blog-module, allowing everything from simple personal blogs to larger with several overall categories/subjects. Providing RSS-feeds for subscribtion
I think katea is more designer than coder.

Re: CGBlog - Help needed - A couple of things

Posted: Sat Nov 21, 2009 8:59 pm
by resistem
I'm having the same problems as katea.

I've got my CGBlog set up pretty much like I want it, with all posts ending with a line like this:

Posted by: Author at Nov 7, 2009 | Category: News

The "News" is supposed to be a link, but all it links to is the root url and not at all to a page which lists all the posts under the News category.

There seems to be something wrong with the code, maybe someone has a solution to this?

Code: Select all

<a href="{$entry->category_url}" title="{$category.name}"> {$category.name}</a>
I've added

Code: Select all

title="{$category.name}"
myself, but other than that it's unaltered.

Re: CGBlog - Help needed - A couple of things

Posted: Sat Nov 21, 2009 10:29 pm
by Jeff
I don't believe {$entry->category_url} is valid use {$entry|@print_r} to check

Re: CGBlog - Help needed - A couple of things

Posted: Mon Nov 23, 2009 2:41 am
by resistem
{$entry->category_url} is what the standard template use, that's why I'm using it.

When I run your check I get this result, so I think you're right that it's not correct:

Code: Select all

[summary] => [postdate] => 2009-11-22 16:11:23 [startdate] => 2009-11-22 16:11:23 [enddate] => [categories] => Array ( [0] => Array ( [category_id] => 1 [name] => News ) ) [fieldsbyname] => Array ( ) [fields] => Array ( ) [file_location] => http://www.mydomain.net/uploads/cgblog/id4 [detail_url] => http://www.mydomain.net/blog/4/name-of-post.html ) 1
So... anyone have any idea why the standard template say {$entry->category_url}, and what should I use instead?

Re: CGBlog - Help needed - A couple of things

Posted: Mon Nov 23, 2009 3:53 am
by Peciura
[summary] => [postdate] => 2009-11-22 16:11:23 [startdate] => 2009-11-22 16:11:23 [enddate] => [categories] ...
Did you inspected variables  in "Browse Category Templates"  ? I think you were scrutinising variables in "Summary Templates".

In "Browse Category Templates" there is an array "{$categories}". and one variable (one category) has 5 properties :
["id"], ["name"], ["sort_order"], ["count"], ["url"]. In sample template you would use variable "{$one.url}"

That is how sample "Browse Category Templates" template looks like:
{foreach from=$categories item='one'}
 {$one.name} ({$one.count})
{/foreach}

Re: CGBlog - Help needed - A couple of things

Posted: Wed Nov 25, 2009 1:09 am
by Jeff
I piece the url by hand. Take a look at the output of the browse cat and then piece it together from what is availible.

Re: CGBlog - Help needed - A couple of things

Posted: Sat Nov 28, 2009 1:07 pm
by darconny
Have you solved this out?

I need this too.. want to put links to both summary and details pages, so visitors could return to the previous CGBlog page. In other words, on summary page I want a link pointing to a 'browse category' page, and on details page link to summary page of related category.

Anyone knows what syntax to use on summary and details templates to get these links?

Thanks
Darko

Re: CGBlog - Help needed - A couple of things

Posted: Mon Nov 30, 2009 8:06 pm
by resistem
Yes, I've looked at the "Browse Category Templates" but I can fuse that code with the other code and get it to work either.

I'll keep trying and will post if I find something, hopefully there's someone else out there that uses this module that has the category links working and can help out.

Re: CGBlog - Help needed - A couple of things

Posted: Tue Dec 01, 2009 10:10 am
by darconny
OK.. thanx.

I solved a part of it, as I have browsecat on a separate page. So, just put a link on a summary page to that unique page, which shows categories.

But I still can't figure out how to derive 'category_url' on a CGBlogs details page, so I can make a 'back' link from article to a related category.

Anyone?

Thank you
Darko

Re: CGBlog - Help needed - A couple of things

Posted: Tue Dec 01, 2009 1:14 pm
by Peciura
Bearing in mind CGBlog is cut down version of News module check this one also
http://forum.cmsmadesimple.org/index.ph ... #msg187187

Re: CGBlog - Help needed - A couple of things

Posted: Tue Dec 01, 2009 3:24 pm
by darconny
Thank you Peciura, but I don't know how to transfer that code to CGBlog :)
Also, you said 'Create page that will show news of appropriate category.'
Does it mean that I have to manually create separate page for every category of my CGBlog? If so, than it's not a good solution as I could have one hundred categories or even more.

I found also this thread:
http://forum.cmsmadesimple.org/index.php/topic,30475.0.html

which deals with 'News title on the title of the page' .. maybe this could help.. have to try that out.

regards
Darko

Re: CGBlog - Help needed - A couple of things

Posted: Tue Dec 01, 2009 6:08 pm
by Peciura
...Does it mean that I have to manually create ....
One page for all categories. What category records will be listed depends only on parameter that will be su
...I don't know how to transfer that code to CGBlog...
There is only one difference - blog record can belong to multiple categories.
a. This is content of page ("dynamic_categories") that will show entries of dynamically chosen category.

Code: Select all

{CGBlog category=$smarty.get.category detailpage=$pagealias}
b. Copy-paste this to blog detail template

Code: Select all

{foreach from=$entry->categories item='one_category'}
{capture assign='urlparam'}&category={$one_category.name}{/capture}
{cms_selflink page='dynamic_categories' urlparam=$urlparam text=$one_category.name}<br/>
{/foreach}
Here is working example at test.lvjc.lt/index.php?page=dynamic_categories
There are 2 blog records and 3 categories, everything is displayed in the same "dynamic_categories" page.

Re: CGBlog - Help needed - A couple of things

Posted: Tue Dec 01, 2009 8:13 pm
by darconny
Thank you Peciura, I can see that this works on your site. Unfortunately I can't get it to work on mine, developing at localhost.

When I click on article, I get a link that shows category that it belongs to (every article belongs to one category), but the link doesn't work - I get 'The requested URL was not found on this server'.
Maybe it's due to internal pretty urls turned on.. don't know.

Also, I'm not sure why do you use l 'detailpage=$pagealias' - is this mandatory or not?

Thanks
Darko