How to set the title of a browser page in Plone - plone

I'm trying to find how I can set the title of a browser:page. The main goal is to have it in the drop down "display" menu on my content type.
I have take a look in the code of CMFDynamicViewFTI. The only example there use browser:view and I don't know what it is, I have never seen browser:view. Is this the solution ? Does browser:view support customerize (The browser:view directive doesn't support the template parameter in zcml).
So is there anyway to set the title (as listed in the "display" menu) of a browser:page?

A browser:page is essentially just a browser:view directive with added support for templates. You can set a title using the zcml directive, just as you can for browser:view.
To set a title for the display menu, add the menu and title attributes to the browser:page directive:
menu="plone_displayviews"
title="title goes here"
You may also need to explicitly include the ZCML for plone.app.contentmenu first to make sure that the plone_displayviews menu is defined:
<include package="plone.app.contentmenu" />

Related

Ckeditor Link Anchor without target _blank?

I'm using CKEditor 7.x-1.x-dev in drupal where I have links defaulted to be set to target _blank.
Is there any way to enable the Target tab for anchor links so I can remove the target _blank or better even default anchor links to not use target _blank?
Possibly in ckeditor/plugins/link/dialogs/link.js or anchor.js ?
EDIT: found in links.js
"url"==p?(c.config.linkShowTargetTab&&a.showPage("target"),f||a.showPage("upload")):(a.hidePage("target"),f||a.hidePage("upload"));
How to change it that it shows that tab for both "url" and "anchor"?
I tried adding it for anchor but then it's not showing anymore for the "url" link type.
But a default to _self would be far better.
ok I think i managed by adding ||"anchor"==p? after the "url"==p definition, works as desired to show the tab for both link types.
Maybe somebody can confirm / help with how to default it to _self for just the anchor?
I have it set to _blank here
a.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentEl
ement("info","linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:b.target,title:b.target,elements:[{type:"hbox"
,widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:g.target,"default":"_blank",style:"width : 100%;",items:[[g.notSet,"notSet"
],[b.targetFrame,"frame"],[b.targetPopup,"popup"],[g.targetNew,
"_blank"],[g.targetTop,"_top"],[g.targetSelf,"_self"],[g.targetParent,"_parent"]],onChange:r,setup:function(a){a.target&&this.setValue(a.target.type
||"notSet");

Placing block inside a node (positioning block between specific elements in node's content)

Basically I created a webform and enabled it as a block, now I want to put that block inside a specific node. I can do that by placing it in a 'content' region and defining the specific node BUT it displays at the end of the content. Now how can I move it between specific elements inside the content?
The node is using a page-type....tpl.php which is used by 5 other nodes as well so I cannot change the code.
To visualize it looks like:
[ content ]
-description text-
-list of videos-
[ end of content ]
and I need to put my webform between the text and the video list. Is there a way?
There are many roads you could take, but since you said you're considering the template file: Why not use a node-specific template, since page is a node type?
Say you're on node/123, then you could use a template named node--123.tpl.php
(see Drupal 7 Template (Theme Hook) Suggestions) and embed your block right there.
Alternatively, you could provide a reusable token in a custom module via hook_token_info and combine it with the commonly used token_filter module. But that might be over the top, if it's just one node you need to touch.
For Drupal 7 a bit of a hacky way to display the contents of a block in content would be to enable the PHP Filter module. Then edit your node and switch to the PHP code Text format and add this code
<?php
$block = module_invoke('block', 'block_view', '1');
print render($block['content']);
?>
where '1' is the block id found in the URL when you edit the block and be sure to include the PHP tags.
Also see this page https://www.drupal.org/node/26502 for more information on placing blocks.
You can use the EVA module to add the webforms in the node as a field.
You basically create a view and choose the "eva field" option then you make sure that this view selects only the webforms you want to have and relates it to the node (the EVA module documentation has much better examples than I can provide).
After you have added it as a field you can place it anywhere in the node.
There is also the Block reference module that could help you.

Joomla menu manager options are not displaying

I have built a menu item where I am trying to apply a custom CSS class in the “Page Display Options.”
I have the settings configured as you can see below:
When I refresh the page, I am getting no title pulling through or the customized hide_password_field class.
I have tried a handful of things that I would think to do with no luck. Examples are clearing cache and emptying browser.
This is most likely because there isn't a style signed to the position for that module. In your templates JDOC element for the module position in question, make sure you have the style attribute set to XHTML.
<jdoc:include type="modules" name="my-position-name" style="xhtml" />

How do I link the logo to an external site?

I would like to change the link in the Plone logo viewlet. By default it points to the Plone site root, I want to point it to a location that is not within the Plone site.
I tried writing a custom logo viewlet, but this seems very complex for such a small change. What is the best way to do this?
The easiest way to change the Logo link is to override the logo viewlet template. This is best done with z3c.jbot.
You need to add z3c.jbot to your projects custom product, by adding it as a dependency in setup.py, and also set up the configure.zcml correctly:
<include package="z3c.jbot" file="meta.zcml" />
<browser:jbot
directory="templates" />
Don't forget to make sure you have the browser prefix added in the <zcml> tag.
You can now copy the logo.pt file from plone.app.layout to the templates directory in your custom product. Rename the file to plone.app.layout.viewlets.logo.pt and change:
tal:attributes="href view/navigation_root_url;
title view/navigation_root_title"
To:
href="http://stackoverflow.com"
Restart the server, and the logo link has now changed.
Alternatively you can edit it via ZMI (/manage) in portal_view_customizations. And search for the "plone.logo" view.
It should open this url in the frame:
/portal_view_customizations/zope.interface.interface-plone.logo/pt_editForm

Wordpress template question

I set a template and my default template is 2 columns and i have a page that i want to have a 1 column. How can I make that in wordpress? is it a code for the functions.php?
Please suggest and thanks in advance.
You have different options and you could choose the one you prefer :)
If your theme already supports a one-column page you should have on the right side of your edit page screen a box "Page attributes" with a select box named "Templates" when you could choose a different template (in default Wordpress theme "TwentyTen" is it called "One column, no sidebar").
If your theme doesn't support a one-column page you could create a custom page template by yourself:
copy and rename "page.php" that you could find inside your theme
in the top comments add this line: * Template Name: The name you want for your template
at the bottom of page.php remove the line <?php get_sidebar(); ?>
now you should have the new template in the side panel "Page attributes".
If you don't like the "new template + select box" way you could directly add a "IF" on your "page.php" to comment-out the get_sidebar() when needed, based on $post->ID or similar checks.
After this probably you'll have to edit your .css (adjusting width) and new-page.php (like adding a class "one-column" to the div container) to fit the dimensions.
Go to the edit page area of the page you want to have single column. Under templates (in the right hand side bar) look for "single column" or "full width" page.
90% of themes have this. If yours does not, you would have to take page.php, download it. Duplicate it and rename it to fullwidth-page.php and reupload. Make sure the comment area at the top is right according to the "page template codex" in wordpress.org. Then, delete out wehre it calls the sidebar() code. Add a bit more inline CSS to the main content area to make the inline style width the full width then.

Resources