Orchard 1.9.1 Duplicating Menu - orchardcms

I just upgraded an Orchard website from 1.7.1 to 1.9.1 and it seems like a number of things were broken in the process. I managed to fix all of them except for one - all of my navigation items in the menu lost the links to their associated content items, so when I started adding them back in for some reason the front-end start duplicating everything. I'm on a custom theme and the menu started showing up properly, but it's duplicating all menu items right in the root with <option /> tags. I can hide those through CSS easily enough, but it's also adding "undefined" in here too, something I can't seem to target and hide.
Any idea why this is happening?
Update I figured out the "undefined" part - it's more of the content menu items being blown out, but this time it was a custom link (just a #, since it didn't go anywhere) that didn't have a URL, so it was showing as undefined. The rogue <option /> values are still here, though I can hide them via CSS. I just don't like that they are in the markup at all.

Related

Liferay 7.4: How to create a configurable web content article footer?

I need to create a footer in a Liferay-project, that can be modified from the instance. I've been trying various things in my footer-code and instance, but haven't figured out how to do it.
Any content inside the footer can't be touched and in page edit mode, Liferay says "This area is defined by the theme. You can change the theme settings by clicking more in the Page Design Options panel on the sidebar". I didn't get any help from Page Design Options either. Is there a way to do this?
I found the answer after hours of work and searching and want to share it with everyone here. The working solution was found here, in one of the comments.
You need to write some code (I use Freemarker/ftl) and then configure the site pages a bit, but here's how it works:
Put a new setting inside liferay-look-and-feel.xml:
<settings>
<setting key="footer-article-id" value="" configurable="true" type="text"/>
</settings>
This will create a new configurable option in page options, allowing you to input the ID of the web content.
NOTE: <theme> might get underlined red "The content of element type "theme" must match". This still prints everything correctly, but the tags are given in a wrong order. Inside my <theme>, I have <template-extension>, <settings> and <portlet-decorator> in that order, which removes the error.
Assign a variable in init_custom.ftl (cleans up the footer-code):
<#assign footer_article_id = getterUtil.getString(themeDisplay.getThemeSetting("footer-article-id"))/>
And then add this to the footer-code, to create the spot, where the content is visible:
<#liferay_journal["journal-article"]
articleId=footer_article_id
groupId=page_group.groupId
/>
After this, everything should be ready code-wise.
Create a Web Content for your footer. In the creation screen, there's an ID on the panel on the right. Publish your content and grab the ID.
Finally, go to Site Builder --> Pages and click on configuration from the top bar (behind three dots). You should see the input field like in the first picture: That's where you add the ID.
Save the settings and your web content should now be in the footer.
Hope this helps!

How to find the origin of some invasive html?

I've been working on the site https://founderspledge.com/ and just noticed that if you go to the main page, and open the Chrome console to view the source, there's an element that I certainly didn't put there:
<div class="pub_300x250 pub_300x250m pub_728x90 text-ad textAd
text_ad text_ads text-ads text-ad-links" style="position: absolute;">.</div>
It also doesn't show up when I run the site's code in localhost, or when I load the page source separately using Chrome's 'View Source' option.
I Googled the div's class list, and the top few hits were from anti-ad blocker software (eg https://github.com/sitexw/FuckAdBlock), which doesn't seem malign, but doesn't explain why it would be on this site.
So
1) How can I get rid of this element?
2) How might it have got there?
3) Does it imply there's a hole in the site's security?
UPDATE: Facebook have acknowledged this as a bug: https://developers.facebook.com/bugs/336662116810282/?hc_location=ufi
I'm so glad to find this issue - have been tearing my hair out to work out the same exact thing! I found it's coming from fbevents.js (https://connect.facebook.net/en_US/fbevents.js) version 2.8.7 - you can clearly see the code that adds the div in. It seems like this is something that has happened very recently? But likewise, I couldn't find anything other than references to anti adblocking scripts which had me concerned!

SPA approach not working if page contains b:carousel

Environment:
I'm writing a SPA with JSF2.2, Bootsfaces 0.9.1, Primefaces 6.0, JEE7 and Hibernate 5.2 in combination with MySQL 5.7 DB.
What I have:
My SPA has a navbar on the upper part and a specific menu based on the selection of the navbar on the left. On the right side and under the navbar I've my main "content page". Similar to this picture but with the difference that my menu is dynamic:
For updating the content page I'm using AJAX.
Everything around the navigation is working as I expected as long as my content page does not contain a b:carousel!
What I tried to do:
As I mentioned above my SPA and all navigation is working correctly unless I add a b:carousel to a content page.
Please consider following example:
I got 2 content pages. Page 1 contains a single label with some text. Page 2 contains a b:carousel with some images. Page 1 is the welcome page.
As soon as I navigate from page 1 to page 2 nothing happens. I need to completely refresh the whole page to see page 2 and even this is not working everytime.
My main question:
Is there any trick to update the content page with ajax if there's a b:carousel on it?
What am I doing wrong?
EDIT:
I created a sample project on github so you're able to see what I mean. I used Java 1.8, Tomcat 8.0.36 and Netbeans IDE, however the project is a Maven project an should work in eclipse, too.
Project: https://github.com/mweber96/stackoverflow39128418
SPA Approach I partly used: http://www.beyondjava.net/blog/single-page-applications-with-bootsfaces/
This question is related to my previous question: Use ui:repeat with b:carousel?
It's a combination of two bugs:
Your example at GitHub uses PrimeFaces, but it doesn't seem to use a PrimeFaces component. The effect is that PrimeFaces adds some fancy JavaScript to load the missing CSS files dynamically (which is great!), but it doesn't add the PrimeFaces core library, so Mojarra runs into an exception it silently hides. You can fix this by adding a (possibly hidden) PrimeFaces component to your page, by including the PrimeFaces core.js file directly (although I wouldn't recommend that) or - of course - by removing the PrimeFaces dependency if you really don't need it.
BootsFaces relies on the HTML attributes to initialize the carousel. To my surprise, this even works, at least partially. However, to start the sliding automatically, you still need to initialize the JavaScript widget manually. In your case, that's
$("#myCarousel").carousel();
BTW, I suggest you open a bug on our bug tracker to fix the latter point (https://github.com/TheCoder4eu/BootsFaces-OSP/issues). Thanks in advance!

Move portlets inside nested-portlet

I added a nested-portlet inside my page. This nested-portlet is a 2-column 50-50 layout. I am able to insert a portlet inside that, but I can't insert one next to another one, although the layout of the nested-portlet has two columns.
Is there anything I am missing?
EDIT: Ok, there is a problem related to the custom theme used. If I set the default theme of Liferay, the problem disappears.
SOLVED: The problem was that the theme I installed forced the portlet divs to be display: block;. I changed that as display:table-cell and the problem disappeared.
Check HTML well-formedness of the page generated by your custom theme. I expect the structure to be broken - for example an unclosed div element may prevent the portlet dropping from working.

MODX revo Wayfinder Not Showing

I'm working with Wayfinder, testing it out to see how it works but for some reason, it's not working and by that I mean that I place the code where it should be and it doesn't output anything at all, I get a blank menu section on my header.
I've been learning form this guide http://codingpad.maryspad.com/2011/02/21/modx-revolution-for-complete-beginners-part-8-using-wayfinder-to-create-menus/
I've followed the instructions on this hands-on video https://www.youtube.com/watch?v=eabBx-KUHjk
as well as the documentation on the wiki.
I placed this on the header to test how the menu loads but nothing happened.
<!-- BEGIN NAVIGATION -->
<nav>
[[!Wayfinder? &startid='0']]
</nav>
<!-- END NAVIGATION -->
The output is nothing at all. The "Hide From Menus" option is unchecked so I'm rather clueless as of why nothing is happening.
I got it to work. It seems it's case sensitive and &startid should be &startId
[[!Wayfinder? &startId='0']]
although I think it's a little odd that if I have more items under the same tree and I use &startid (lowercase) it lists everything but the root document but if I use it with capital "I" then it lists everything starting from the root.
In any case, it's working now.

Resources