Page 1 of 1

Pages: removing items from the Content Type list?

Posted: Thu Jan 08, 2009 5:42 pm
by sn3p
How can I remove "Sections Header" and "Separator" from the Content Type list?

Thanks in advance!

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

Posted: Thu Jan 08, 2009 6:47 pm
by Dr.CSS
First up, Why?...

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

Posted: Thu Jan 08, 2009 6:55 pm
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.

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

Posted: Thu Jan 08, 2009 7:05 pm
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... ;)

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

Posted: Thu Jan 08, 2009 7:18 pm
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.

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

Posted: Thu Jan 08, 2009 7:33 pm
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...

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

Posted: Thu Jan 08, 2009 8:19 pm
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>";
	}
}