Customising Plone 3 sharing tab - plone

Where do the titles "Can add", "Can edit", "Can view" and "Can review" come from in the plone 3 sharing tag?
What is the difference between "Can view" and "Can review"?

"Can view" refers to the View permission which essentially controls who can view a given piece of content.
"Can review" refers to a Reviewer role which states who will be able "Review" content in the context of the publishing workflow.
These local roles are defined in plone/app/workflow/localroles.py

For what it's worth, sharing tab roles in Plone 4 will be much easier to customize using GenericSetup. A custom sharing.xml step will look something like:
<sharing xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="plone">
<role
id="CopyEditor"
title="Can edit copy"
permission="Manage portal"
i18n:attributes="title"
/>
</sharing>

Related

Add related Keyword Google Custom Search (CSE)

I use Drupal 7 with MetaTags Module. But this is not a Drupal specific problem.
This Website use the CSE (Google Custom Search) to find content.
Now, i want to add to each content related keyword.
When I create a content about italy, so the related keyword are e.g. "pizza, pasta, fiat ..."
Now I think the "< meta keyword />" would be the solution. But this dont work.
If I add the keywords in the "< meta description />", after reindexing i find the "italy" content when i search "pizza". But the "< meta-tag description />" is reserved for google result
Is there not a simple solution with "" tag?
Best regards
I've found a solution.
I add synonyms for Search Results
https://support.google.com/customsearch/answer/2631030?hl=en

Wordpress Contact Form 7 missing form name

I'm using WordPress 4.2.2 and Contact Form 7 version 4.2.1. But when my contact form shortcode outputs the html code the name="" attribute is blank and W3C html validator is giving me errors because of this. How can I fix this.
It's called "Contact form 7", but I guess that is beside the point.
You can set the form name attribute using the html_name attribute of the shorttag like this:
[contact-form-7 id="7" title="My awesome contact form" html_name="my_awesome_contact_form"]
It actually seems a bit strange that this is empty by default since that is considered invalid markup - so you may want to contact the developer(s) and let him / them know, so it can be fixed - I can't even find any documentation referencing the html_name attribute - I only found it by looking directly in the source...

Page title shows "title | sitename"

I have upgraded my development site to the latest Panopoly release and now my page titles include the site name. The daftest example is the contact form, which now has the title "Contact us | sitename". I've played with various options in my panels content settings, even tried the Page Title module (I see there are issues for it in Panopoly so not surprised that hasn't worked). I find it hard to imagine it's an issue and suspect I've (unwittingly) done something wrong?
Try https://www.drupal.org/project/metatag
Change globals here
/admin/config/search/metatags/config/node
Change specific content types by:
● admin/config/search/metatags/config/add
● Select Type Dropdown: “THE CONTENT TYPE YOU WANT TO CHANGE”
○ Add and configure
*Example below using tokens
○ Page title: “[site:name] at [node:title]”

How to define default views in Plone

I have already a page template for the default view of a Plone site (main page).
How to define the default view of a folder? This default view should use a page template.
Try this:
navigate to the desired folder
add "/manage_propertiesForm" at the end of the url
in the resulting form add this property:
name: "layout"
type: "string"
value: the page template name without extension
Use the answers above if you want to set one of the default views (tabular, thumbnail, etc), but if you want to choose a particular content item for the default view of the folder, you can do it in the ZMI as suggested:
navigate to the desired folder
add "/manage_propertiesForm" at the end of the url
in the resulting form add this property:
name: "default_page"
type: "string"
value: the id of the content item
or do it programmatically in Python:
content_id = "Name of the Content Item"
folder.manage_addProperty('default_page', content_id, 'string')
Hope this helps!
Using the information and links send both by Giacomo Spettoli and by Mikko Ohtamaa, another guy from my work team was able to find a solution for our case:
do as indicated by Giacomo (navigate to desired folder, etc.)
include a new directive in the configure.zcml file (this was found by on of my team mate Mr. Mariano):
<browser:page for="OFS.interfaces.IFolder" name=<name of the page template file> class=<name of the class used by the above template file> permission="zope2.View" />
Thanks to Giacomo and to Mikko; their answers helped us solve this issue.

How to quickly theme a view?

I've defined a view with the CCK and View 2 modules. I would like to quickly define a template specific to this view. Is there any tutorial or information on this? What are the files I need to modify?
Here are my findings: (Edited)
In fact, there are two ways to theme a view: the "field" way and the "node" way. In "edit View", you can choose "Row style: Node", or "Row style: Fields".
with the "Node" way, you can create a node-contentname.tpl.php which will be called for each node in the view. You'll have access to your cck field values with $field_name[0]['value']. (edit2) You can use node-view-viewname.tpl.php which will be only called for each node displayed from this view.
with the "Field" way, you add a views-view-field--viewname--field-name-value.tpl.php for each field you want to theme individually.
Thanks to previous responses, I've used the following tools :
In the 'Basic Settings' block, the 'Theme: Information' to see all the different templates you can modify.
The Devel module's "Theme developer" to quickly find the field variable names.
View 2 documentation, especially the "Using Theme" page.
In fact there are two ways to theme a view : the "field" way and the "node" way. In "edit View", you can choose "Row style: Node", or "Row style: Fields".
with the "Node" way, you can create a node-contentname.tpl.php wich will be called for each node in the view. You'll have access to your cck field values with $field_name[0]['value']
with the "Field" way, you add a views-view-field--viewname--field-name-value.tpl.php for each field you want to theme individually.
Thanks to previous responses, I've used the following tools :
In the 'Basic Settings' block, the 'Theme: Information' to see all the different templates you can modify.
The Devel module's "Theme developer" to quickly find the field variable names.
View 2 documentation, especially the "Using Theme" page.
A quick way to find the template files you can create and modify for a view in Views 2.0 is to:
Edit the view
Select the style (e.g. page, block, default)
In the 'Basic Settings' block click on 'Theme: Information' to see all the different templates you can modify.
The Devel module's "Theme developer" feature is handy for seeing what template files Drupal is looking for when it goes to theme something. See the screenshot on that page for an example.
You should also check out Semantic Views. For simple Views theming, it is really handy.
One tip:
You'll likely have a number of views which require similar formatting. Creating templates for each of these views and copying them creates a nightmare of code branching - if you're asked to change the whole look and feel of the site (implying changing the display of each of these views formatted in this particular way), you have to go back and edit each of these separately.
Instead of using the views interface to select new templates for views, I sometimes simply insert some code branching into a single views file. E.g. for one site in views-view-fields.tpl.php I have:
if($view->name == 'articleList' || $view->name == 'frontList'
|| $view->name == 'archiveList') {
/* field formatting code */
} else {
/* the default code running here */
}
This then modifies the fields in the way I want only for this family of Views = articleList, frontList and archiveList - and for other views using this template runs the code one normally finds in this template. If the client asks, "Hey, could you make those pages showing the archives & that list on the front page to look more like ( ... )", it's simply a matter of my opening & editing this one file, instead of three different files. Maintenance becomes much more quick & friendly.
for me block-views-myViewName-myBlockId.tpl.php works
My shortcut option.
Go to theme.inc file in YOUR_MODULE_DIR/views/theme/ folder.
In the _views_theme_functions function print the $themes variable or put a breakpoint on the last line of the function to see the content of the variable.
Just convert views_view to views-view and __ to -- and add your template extension to get desired file name.
For example if an element of the $themes array is views_view__test_view__block (where test_view is the name of your view) then the name of the template file would be views-view--test_view--block.tpl.php.
In my opinion the simplest way to decide which template file to use for theming the views is :
1) Click on admin/build/views/edit/ViewName -> Basic Settings -> Theme
Clicking this would list all the possible template files. Highlighted (File names in Bold) files indicate which template file is being used to do theme what part of the view. After incorporating the required changes in the relevant view template file RESCAN .. now you should be able to see the changed template file highlighted .
If you want to do quick Drupal development with a lot of drag-and-drop, the Display Suite module def. is a something you should use: http://drupal.org/project/ds
According to me there are two ways to do it:
Programatic Way:
Go to edit view.
Select page/block style.
Go to 'Basic Settings' and click on 'Theme: Information' to see all the different templates you can modify.
Add the html you want to theme and print the variables of the view wherever needed
Configuration Update: The Display suite provides us an option to place your labels inline or above and add even to hide them. Custom classes to each of the view's elements can be added too.
Advanced options include:
Exportables
Add your own custom fields in the backend or in your code
Add custom layouts in your theme (D7 only)
Change labels, add styles or override field settings (semantic fields).
Full integration with Views and Panels
Extend the power of your layouts by installing Field Group
Optimal performance with Object cache (D6) or Entity cache (D7) integration

Resources