PDA

View Full Version : CMS: exclude section from primary content


scarex
09-06-2010, 12:28 PM
Hi everybody.

I was wondering if it was possibile, in some way, to configure CMS Front Page Primary Content in order to fetch articles ONLY from e selectable subset of sections.

I look for informations, finding several threads on vbulletin.com:
For instance: this one (http://www.vbulletin.com/forum/showthread.php?334908-Is-there-a-way-to-write-an-article-and-not-have-it-show-up-on-the-main-CMS-page&highlight=home+section+content) or this one (http://www.vbulletin.com/forum/showthread.php?325135-Please-Add-Ability-to-Hide-Articles-from-Child-Sections&highlight=home+section+content)

this one (http://www.vbulletin.com/forum/showthread.php?334827-sections-categories-and-content&highlight=home+section+content) is the most interesting...

Anyway, it seems (even after a long trial session with my vbulletin installation) that's it's not possible: you can choose to display article from ALL subsections, or to display articles only from current section.

Is it correct?

Does anybody the same issue and already tried to create a mod for this or now in which file the query is written, in order to perform such "exclusion" directly in code?

Thanks

--------------- Added 1283836783 at 1283836783 ---------------

Found it.

The query is performed in file packages/vbcms/collection/content/section.php

Adding the condition "AND node.parentnode NOT IN (SectionID_List)" to ON clause, it works.

Rho'd Berth
11-29-2010, 09:18 AM
Hi scarex,

Can you please explain a bit more how you fixed it?
What change should I make in the section.php file? Where should I make it?

Thanks in advance,

Robert

scarex
11-29-2010, 08:24 PM
Hi scarex,

Can you please explain a bit more how you fixed it?
What change should I make in the section.php file? Where should I make it?

Thanks in advance,

Robert

I've edited packages/vbcms/collection/content/section.php. In 4.0.8 release, in getLoadQuery function you can find the query in $sql variable.

Before $sql statement, I declared the following variable

$restriction ="AND node.parentnode NOT IN (5,154)";
and I used it in $sql statement

" INNER JOIN " . TABLE_PREFIX . "cms_node AS rootnode
ON rootnode.nodeid = " . intval($this->filter_node) .
" $restriction AND (node.nodeleft >= rootnode.nodeleft AND node.nodeleft <= rootnode.noderight) AND node.nodeleft != rootnode.nodeleft ".

Fenriz
08-05-2011, 08:21 AM
Could you be more specific plz. How to exclude f.e. "section 19" to be listed from cms home?

doopz
08-24-2011, 02:17 PM
Ok, so this removes the whole section, not just from the CMS home.
anyone else any suggestion on how to not display a certain section on the CMS index, but do allow the section to be viewed?

Phases
05-24-2012, 02:19 AM
I would really REALLY to exclude certain sections from aggregating on the main CMS page..