Page 1 of 1
CGBlog categories make case insensitive
Posted: Tue Oct 28, 2014 1:10 am
by applejack
I need to make CGBlog categories case sensitive as they used to be in the latest version. I'm not sure in which version of CGBlog this changed as I did a test upgrade of a site which hadn't been updated for a while and is running version 1.10.2
Making them case sensitive means that you cannot automate them based upon the page alias which is not good and ought to be a convention which applies to all modules where using automation based upon page alias might be required.
Re: CGBlog categories make case insensitive
Posted: Wed Oct 29, 2014 4:19 am
by Jeff
applejack wrote:I need to make CGBlog categories case sensitive as they used to be in the latest version. I'm not sure in which version of CGBlog this changed as I did a test upgrade of a site which hadn't been updated for a while and is running version 1.10.2
Making them case sensitive means that you cannot automate them based upon the page alias which is not good and ought to be a convention which applies to all modules where using automation based upon page alias might be required.
Standard convention for linux servers is that the path part of the url is case sensitive. I don't see why case senstivity (i cant tell which way you want it, your post reads contradictory) affects automation.
Jeff
Re: CGBlog categories make case insensitive
Posted: Wed Oct 29, 2014 11:48 am
by applejack
Ok hopefully this is clearer.
Blog category = Latest News
Page alias = latest-news
In the page latest-news Smarty tag call a global content block which is
{CGBlog category="$page_alias|replace:'-':' '"}
In case you are wondering why not just use the actual blog category casing in the call, in this particular case it is for a site with over 5,000 articles and growing and around 100 pages and blog categories of which some categories have casing such as IPN News and so don't follow a casing convention.
My server also happens to be case insensitive in url paths.
Re: CGBlog categories make case insensitive
Posted: Wed Oct 29, 2014 12:18 pm
by nikkio
I've made the same thing using this:
Code: Select all
{CGBlog number="16" summarytemplate="ptv_category_list" category="{title}" detailpage="dettaglio-notizia"}
on this website
http://www.puntotvonline.it/
and it works quite well, you can see the pages in "notizie" and "comuni" submenu.
Re: CGBlog categories make case insensitive
Posted: Wed Oct 29, 2014 12:31 pm
by applejack
Thanks nikkio that may work but using page alias is potentially more reliable.
The main point in this is that the categories in CGBlog didn't used to be case sensitive and I can see no good reason why they should be, as are you really going to want to have 2 categories with the same name but different casing and this doesn't necessarily just apply to this module but should be the case for all modules.
Re: CGBlog categories make case insensitive
Posted: Thu Oct 30, 2014 7:09 am
by Jeff
If you want a "human-readable" blog category then you should do as nikkio suggested and use a "human-readable" field like Title or Menu Text. With your current approach you will probably run into more problem.
Jeff
Re: CGBlog categories make case insensitive
Posted: Thu Oct 30, 2014 5:19 pm
by applejack
I don't think so. I have been doing it this way on many sites using CMSMS for the past 8 years without any issues until now.
With it being case sensitive there is more likely to be human error from a client. Using menu text or title it is easy for a client to have a trailing space for instance or get the casing wrong which is not possible with page alias if the categories are case insensitive and as I said there as far as I can see no good reason why they need to be.
Re: CGBlog categories make case insensitive
Posted: Wed Dec 17, 2014 7:17 pm
by Dr.CSS
If you need uppercase categories to link to page alias which is always lower case you can use
|lower in your call like replace...
Re: CGBlog categories make case insensitive
Posted: Wed Dec 17, 2014 8:09 pm
by applejack
That won't work as the CGBlog categories are case sensitive these days, unlike before, for which I can see absolutely no good reason for.
If the CGBlog category is i.e. IPN News then by using smarty lower or upper function won't work.