<![CDATA[ [SOLVED] Articles show in pdoMenu navigation after import from Wordpress - My Forums]]> https://forums.modx.com/thread/?thread=96503 <![CDATA[ [SOLVED] Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522320
I have created a blog in a new website using Articles. The navigation in the website is run by pdoMenu. Initially, I added a dummy article and from what I remember the navigation worked fine, ie. the article does not appear in the drop-down menu.

Next, I imported a large number of blog posts from the client's current Wordpress blog, using the export to .xlm and Import Articles from Wordpress method which ran smoothly. However, now suddenly all of my articles appear as sub-menu items in my navigation, leading to a very large drop-down menu!

I have tried to exclude the Articles resource from the pdoMenu call with &parents=`0,-10` (the Articles container is resource 10) but whereas that does remove the Articles dropdown, it also stops all other sub-menus from generating which is obviously not what I want.

Then, I tried adding &showHidden=`0` even though that should be the default anyway but it does not solve the issue.

As I mentioned, I think this only happened after I imported from Wordpress - so could that process have overridden the default "hidden" status of the articles that were imported??

Any advice appreciated.]]>
intandem Mar 10, 2015, 12:07 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522320
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522343
update modx_site_content set hidemenu=1 where parent=10
although I had to do it without the semi-colon from your line above. Absolutely delighted! Was tearing my hair out. Thank you all so much!
]]>
intandem Mar 10, 2015, 03:54 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522343
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522341

$docs = $modx->getCollection('modResource', array('parent' => 10));

foreach ($docs as $doc) {
    $doc->set('hidemenu', '1');
    $doc->save();
}


Batcher will also do it, but it will toggle hidemenu, so any you've done manually will be undone.]]>
BobRay Mar 10, 2015, 03:44 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522341
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522340 spackko Mar 10, 2015, 03:43 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522340 <![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522339
Just took a look and those files all have Hidden set to 0. Changed one of them to 1, cleared cache and it has disappeared from the drop-down! Whoohoo!

Can I be bold and ask you if there's a command to change all of those under parent resource 10 to hidemenu=1? Don't have mysql skills sad

]]>
intandem Mar 10, 2015, 03:41 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522339
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress (Best Answer)]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522335
If so, you can update your database:
(if the Articles container has id 10)

update modx_site_content set hidemenu=1 where parent=10;
]]>
spackko Mar 10, 2015, 03:28 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522335
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522334 intandem Mar 10, 2015, 03:23 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522334 <![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522333

have you access to your database?
check modx_site_content. there you can see if your settings are correct.

you can check the children of resource 10

select id,hidemenu from modx_site_content whre parent=10


]]>
spackko Mar 10, 2015, 03:19 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522333
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522331
[[pdoMenu?
    		&parents=`0`
    		&level=`3`
		&outerClass=`menu`
		&parentClass=`sub-menu`
		&hereClass=`current-menu-item`
		&showHidden=`0`
]]


Have tried your code above but it has not thrown anything up really, just that the Articles menu item shows as a parentRow but really it shouldn't? I've even tried to untick the "Container" box in Articles but that still doesn't make a difference.

I also just tried to replace the pdoMenu call with a Wayfinder call but the same thing happened. Which makes me think it must have something to do with the way the Wordpress blog was imported???]]>
intandem Mar 10, 2015, 03:10 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522331
<![CDATA[Re: Articles show in pdoMenu navigation after import from Wordpress]]> https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522328
try to replace it for trouble shooting with this one:

<!-- Testpattern for pdoMenu -->

[[pdoMenu?
	
	&parents = `0`
	&level = `2`

	&cache=`0`

	&tplOuter = `@INLINE <ul[[+classes]]>
	[[+wrapper]]
	</ul>`
	&tpl = `@INLINE <li[[+classes]]><a href="[[+link]]" [[+attributes]]>[[+menutitle]]</a>
	[[+wrapper]]</li>`


	&tplParentRow = `@INLINE A`
	&tplParentRowHere = `@INLINE B`
	&tplHere = `@INLINE C`
	&tplInner = `@INLINE D`
	&tplInnerRow = `@INLINE E`
	&tplInnerHere = `@INLINE F`
	&tplParentRowActive = `@INLINE G`
	&tplCategoryFolder = `@INLINE H`
	&tplStart = `@INLINE K`

	&firstClass = `1`
	&lastClass = `2`
	&hereClass = `3`
	&parentClass = `4`
	&rowClass = `5`
	&outerClass = `6`
	&innerClass = `7`
	&levelClass = `8`
	&selfClass = `9`
	&webLinkClass = `10`

]]


that gives you placeholders where you can check if something is missing.]]>
spackko Mar 10, 2015, 02:58 PM https://forums.modx.com/thread/96503/articles-show-in-pdomenu-navigation-after-import-from-wordpress#dis-post-522328