Removing Content Blocks

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
dwave
Forum Members
Forum Members
Posts: 39
Joined: Mon Aug 13, 2007 11:15 am
Location: Israel

Removing Content Blocks

Post by dwave »

I noticed that content blocks for a page remain in the database even after the template is changed:

1.) assign template containing a content block (i.e. {content block="test" }
2.) replace the template with another, not containing the content block ({content block="test"}
3.) the variable "test" is still set

Any ideas how to reset content blocks on template change?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Removing Content Blocks

Post by Wishbone »

I like it that way, because there were several times when I accidently removed a {content} tag, later realized it, put it back, and my content was still there.
dwave
Forum Members
Forum Members
Posts: 39
Joined: Mon Aug 13, 2007 11:15 am
Location: Israel

Re: Removing Content Blocks

Post by dwave »

Yes, it's useful at times.

It's not a bug report or feature request, I just need a different behavior for content blocks in a rather special case.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Removing Content Blocks

Post by Wishbone »

You can always remove them from the database using phpMyAdmin if you're extra careful..

What's the special case?
dwave
Forum Members
Forum Members
Posts: 39
Joined: Mon Aug 13, 2007 11:15 am
Location: Israel

Re: Removing Content Blocks

Post by dwave »

Some background information: I have a little little smarty loop that displays a catalog of sub-pages as thumbnails. The style of some of the thumbnails is controlled by a parameter that I put in a content block.
If the webmaster switches templates without resetting the parameter in the content block first, then he's confused why the thumbnail still shows up in the catalog. The manual way to reset content blocks is fairly easy but to streamline operations I look for an automated way to reset content blocks on template change.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Removing Content Blocks

Post by Wishbone »

I have a similar thing going on one of my sites, and I actually used this 'feature' to my benefit.

I had a list of icons and page titles corresponding with subpages. The icon was uploaded using GBFilePicker as a content type. The issue is that one of the 'pages' was an external link (no template). I set it to the normal template, uploaded the icon, then switched it back to being an external link. The content block containing the icon path still existed, and an icon could be used.

There might be some property somewhere, or a way to scan to see if a content block is 'active' .. However, I suspect that the list of content blocks is generated dynamically when the template is parsed.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Removing Content Blocks

Post by Dr.CSS »

I think you might want to tell us what version of CMSMS you are using, I thought this feature/bug was removed recently...
Post Reply

Return to “CMSMS Core”