Starter Info: Working with Plone 4.0.7 on CentOS 5.5 with Python 2.6.6.
I've got a folder that contains a few pages and I want to have a navigation portlet on all of the child pages but not the parent folder. My first thought of how to do this was to add the navigation portlet to the parent folder, pointing to itself, and setting the start level to 1. This works for not showing the portlet on the parent, but none of the child Pages are showing the portlet. I assume this is because the Pages aren't a folderish content type so the start level doesn't apply to them. Does anyone know where I would start to look to create a work around for this?
Thanks
I can confirm the issue.
The problem seems to be, that pages/documents are not recognized as subsections but as an item of the containing folder.
You can counterproof that, if you add folders to your folder, with them the navigation will work as you expect.
As a workaround you could use CSS to hide the navi on the folder with sth like:
.portaltype-folder .portletNavigation { display: none; }
Actually your method is the right method:
add the navigation portlet in the parent folder
set the initial level to 1. If child pages don't diplay the portlet check if they block the parent portlet acquisition.
go to every child folder and block the portlet acquisition. If the number of child folder is hight, you can programmatically block the acquisition
Related
On the Foundation site I am working on, there is a dropdown topbar in a navigation partial that populates its links from several YML files in src/data (one per dropdown category). Each entry looks something like this:
link:
text: "Example Link"
url: "beta/page2.html"
external: false
The piece of the partial that generates each menu entry is as follows:
{{#each category}}
<li><a href="{{#unless external}}{{root}}{{/unless}}{{url}}" {{#if external}}target="_blank"{{/if}}>{{text}}</a></li>
{{/each}}
The goal is for the link to be relative to the site's root if external is false, and used as-is (and open a new tab) if external is true.
The problem is that internal links don't seem to generate properly when the page I am navigating from is in a subdirectory. For example, if I am on example.com/alpha/page1.html, the menu link above points to example.com/alpha/beta/page2.html instead of example.com/beta/page2.html.
How can I change my code to properly generate the links for the pages?
I figured out the issue. Inside the {{#each}} block, the Handlebars context changes, making variables like {{root}} only accessible through the parent context. The issue can be fixed by replacing {{root}} with {{../root}}.
From the Handlebars documentation:
The exact value that ../ will resolve to varies based on the helper that is calling the block. Using ../ is only necessary when context changes, so children of helpers such as each would require the use of ../ while children of helpers such as if do not.
I am using Plone 4.1.4 with Doormat and Diazo in an institute I work and the Footer has to be made manually by adding each column and item that links internally to items from main menu.
What I want is that this footer, which is the site map, to change automatically every-time some user create, edite or delete an item from the main menu (content folders).
When I got the job I noticed many of those links in footer are out of date, and as there are many users in their each sections of the institute that are allowed to change the structure, I know they won't update both folders and footer.
I searched the Internet for some product or tip but I cant' find anything that resolves that problem.
If your Diazo theme was created as a Python package using mr.bob or zopeskel, you probably already have z3c.jbot, which allows you to easily override templates, available. If so, you likely have a template_overrides or similar directory in the package. If so, just drop into it a file named plone.app.layout.viewlets.footer.pt with the contents:
<div i18n:domain="plone"
id="portal-footer">
<ul id="portal-doormat"
class="navTreeLevel0 visualNoMarker">
<tal:sitemap replace="structure context/##sitemap/createSiteMap" />
</ul>
</div>
Then style away!
Alternatively, you may replace the colophon by naming the file plone.app.layout.viewlets.colophon.pt.
If you aren't using a Python package for your theme (if the Diazo theme was created through-the-web) then you may use the portal_view_customizations tool in the ZMI to make the same template override.
You may wish to also customize the depth of the site map. That may be changed via the portal_properties tool, navtree_properties property sheet. Or, just use CSS to hide unwanted depth.
An alternative and much easier way to realize your demand, can be to use portlets instead of viewlets, in combination with the addons "Products.ContentWellPortlets" and "collective.portlet.sitemap":
1.) Hide the footer-viewlets via a GenericSetup-config like in this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/viewlets.xml
2.) Assign a sitemap-portlet in the footer-area via a GenericSetup-config, similar to this example:
http://svn.plone.org/svn/collective/adi.simplestructure/trunk/adi/simplestructure/profiles/default/portlets.xml
Tip: First assign the sitemap-portlet via the Web-UI, then go to [SITE-URL]/portal_setup, search for "portlets", check its box and click the export-button on the bottom, to get the needed xml-file.
I want to hide the date on this page.
I tried to change it inside joomla but I couldn't. It's not an article but a JKit page and there is no such an option.
I used the "inspect element" feature to find the corresponding css file and line (bootstrap.css #554). When I change the element through the "inspect element" menu its working but when I open the css file and change it, it doesn't work.
Any suggestions how I can hide it?
p.meta {display: none;}
That ought to do it. Granted, any other metadata will also be hidden. You should add this to a custom CSS file and not modify core Joomla or extension files.
I find it hard to believe that jKit doesn't have a setting for that. (Update: I see that jKit is very new and lacks good documentation.) Also, a template override might be more to your liking.
Most Joomla components allow you to control things like this in the options for the items and also in the menu options when creating a menu link (or setting the global options to change the default behavior. If this component does not, make either an alternate layout or a template override (depending on whether you want to always change this or just on this one page). If you go into the template manager, template view there is a system in place that will automatically create a copy of the layout and put it in the right location. Just edit that to show what you want.
Ok so I solved by editing the according .php file of the component.
I just removed the echo line of the date.
Nothing else worked.
I've recently started getting familiar with Atlassian Confluence (v. 3.3), but I'm having trouble understanding the best way to use page hierarchies within a space.
Within a space, pages can be located underneath the "Home" page, or one level higher, next to the home page. However, in the "Documentation" theme, the left sidebar page hierarchy is only shown for pages rooted below "Home". This means that the "Home" breadcrumb is always displayed when viewing pages that appear in the sidebar hierarchy.
So, what is the purpose of having pages on this top level? Should it be used specifically to hide pages from the sidebar hierarchy (like meta)?
Is it possible to have the sidebar hierarchy display for pages rooted next to Home (on this top level), instead of below it?
Is it possible to remove the Home breadcrumb?
How many of these questions are made irrelevant by later updates to the software?
The only real purpose I can think of for having a page on the same level as the home page would be to disclude it from a page-tree display starting at the home page. So if you have some pages you use for holding images, documents, testing content, et cetera then you would not want it to show up in the hierarchy viewed by regular users.
When you define a page-tree macro, or the children-display or anything similar, you can specify which page it is displaying the hierarchy from. If you want to use a page other than the home page, just specify it in the page-tree macro.
I don't believe it is possible to remove the breadcrumb, or at least I don't know how.
Software updates will maybe bring some other page-tree-esque options but won't fundamentally change anything else we're talking about here.
So, what is the purpose of having pages on this top level?
Specifically? You'd have to ask Atlassian.
Generally? The default configuration is that only pages from the specified Home page down are shown in the navbar.
Should it be used specifically to hide pages from the sidebar hierarchy (like meta)?
Yes. Any page which is used for navigation, control or configuration is stored at the top of the hierarchy. That way they don't show up in the navbar.
Using the {alias} macro will create a page in the top hierarchy.
If you use a page as input to your navbar then this page can be stored here out of user sight but still publically visible. So, if you had a page with lots of markup for a colourful and exciting navbar named SpaceNavigation then in the Documentation Theme Configuration you would have this code:
{include:SpaceNavigation|nopanel=true}
Is it possible to have the sidebar hierarchy display for pages rooted next to Home (on this top level), instead of below it?
Yes. Use the pagetree macro.
{pagetree:root=#none}
You can edit the space theme to show anything in the left navigation bar.
Browse > Space Admin > Theme > Configure theme
Untick the 'Page Tree' option at the top. Put your code to display content in the navbar in the navigation box.
If you want a pagetree somewhere in your custom navigation use the {pagetree} macro. You can set the root page to a page lower in the hierarchy. {pagetree:root=apple}
The {children} macro is also useful here.
The reporting macros can print a list of all pages in a space. You can build your own macro or import a wiki page to display as the navbar.
Is it possible to remove the Home breadcrumb?
This may need clarification. Are you looking to remove the breadcumbs or just the word 'home'.
Either way, the answer is 'JavaScript or CSS'.
If you are a space administrator you can add CSS styles to the space to disable CSS for the space from the header.
If you have the {html} macro or {style} then you can add styles and JavaScript to the wiki page.
If you are a wiki administrator, or have one on your side, then you can create a macro or plugin to put CSS or JavaScript code on the page.
Here is a code sample to find two classes on a page and after the page has loaded (document.ready) hide them.
{html}
<script type="text/javascript">
AJS.$(document).ready(function() {
AJS.$(".first").hide();
AJS.$(".second").hide();
});
</script>
{html}
This example will remove the word 'Dashboard' as it has the class of 'first'.
Go forth and write the code to find the objects that so draw your ire and vanquish them.
CSS is also an option and sometimes less messy.
Some CSS objects can be removed from the page from within the page. E.g:
{html}
<style type="text/css">
ol.breadcrumbs { visibility:none; !important; }
</style>
{html}
However, to remove objects at the top of the page you need to use javascript or put CSS in the space style sheet.
Browse > Space Admin > Stylesheet
How many of these questions are made irrelevant by later updates to the software?
It's pretty much the same. Some styles have changed. Some things have been moved around. The general look has changed.
Some of the style sheets have changed and they have said that they are looking to deprecate the Documentation Theme. However, given the community support for the Documentation Theme even if they remove it no doubt it will be available as a downloadable theme in V6.
If you are interested in looking at this yourself then you can download Confluence V5 with a trial licence or try their OnDemand free for one month.
Using Plone 4.1.4.
Have a container called /employment which has a default view of a page also called employment.
There's an additional page in the employment container called foo
When I add anchor tags (either via TinyMCE or straight html) it "automagically" links to the parent folder instead of the current page.
I'm on http://www.example.com/employment/foo
I try and add a link <a href="#bar"> on the foo page.
I'd expect the link to be http://www.example.com/employment/foo#bar when rendered
BUT instead it's showing up as http://www.example.com/employment/#bar
Any idea why it's defaulting to the parent "folder" instead of the page its currently actually on? Is it some weird caching issue or url rewriting voodoo?
Do you have "Link using UIDs" enabled in TinyMCE's settings? UID-linking enables a URL-rewriting filter, which resolves all relative links to absolute ones. Id had issues with relative links, but those should be fixed in plone.outputfilters >= 1.2 (e.g. it doesn't try to "fix" anchor links anymore).
You might be falling victim to a base tag here. The base tag is used by browsers to decide the reference point for relative links. If the base tag says that the base URL is your container, then the relative links you create will end up being rendered relative to that.
Check the value of base in the head of your rendered page to see if this is the case.
This was still relevant issue for me working with dexterity content types in Plone 4.3.3.
At first the anchor links worked normally when I created a non-folderish content type. But the anchor links behaviour changed after I converted it to folderish container type.
After seeing the answer by Cris, I believe that the base tag changes according the type of the content if it is folderish or not. Yet the navigation links (e.g. in portlet nav tree) don't. This brakes the usage of anchor links.
A ticket has been submitted about this, and the resolution seems to be to remove the base tag completely in plone 5.0.
For plone 4.3.3. I can only think of using absolute urls for the anchor links in my folderish content type's template.
<a tal:attributes="href string:${context/absolute_url}#anchor">My Anchor</a>