Pages: removing items from the Content Type list?

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
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Pages: removing items from the Content Type list?

Post by sn3p »

How can I remove "Sections Header" and "Separator" from the Content Type list?

Thanks in advance!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Pages: removing items from the Content Type list?

Post by Dr.CSS »

First up, Why?...
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Pages: removing items from the Content Type list?

Post by sn3p »

The website is for a client, and since the menu structure doesn't need Sections Headers and Separators I prefer to disable them.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Pages: removing items from the Content Type list?

Post by Dr.CSS »

OK, well 2 ways, either do it with CSS, display:none or hack the PHP file to get them to go away, either way if it gets updated you will have to do it again, just tell them not to use them, or let them and charge them to fix it... ;)
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Pages: removing items from the Content Type list?

Post by sn3p »

In what PHP file are these content types processed? I still prefer to remove them from the list ;)
CSS display:none is not an option because I don't want to hide the whole list, but only 2 options.

Thanks for the help.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Pages: removing items from the Content Type list?

Post by Dr.CSS »

OK well I don't know exactly which file it is but it is in the admin folder, I would do a page edit/add thing and right click to view source find the part it is in then go thu the PHP files in admin folder till I found something that looked like it and put a number or some kind of marker there then look at page edit again to see if it shows, doing this till I get the right part then comment it out or ? to get it to not show...
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Pages: removing items from the Content Type list?

Post by sn3p »

Thank for the quick replies. In addcontent.php and editcontent.php the contenttypes are fetched via $gCms->contenttypes. I'm not sure where this array is build, but I used a quick hack to exclude the sectionheader and separator from the list.

addcontent.php and editcontent.php:

Code: Select all

foreach ($gCms->contenttypes as $onetype)
{
	if ($onetype->type != 'sectionheader' && $onetype->type != 'separator')
	{
		$contentops->LoadContentType($onetype->type);
		$type_obj = new $onetype->type;
		$typesdropdown .= '<option value="' . $onetype->type . '"';
		if ($onetype->type == $content_type)
		{
			$typesdropdown .= ' selected="selected" ';
			$cur_content_type = $onetype->type;
		}
		$typesdropdown .= ">".($type_obj->FriendlyName())."</option>";
	}
}
Post Reply

Return to “CMSMS Core”