Is it possible to rename the id of Plone's "Members" folder? I want to use the term "Accounts" instead. I tried doing it via folder_listing and rename. It works but "My Folder" in the user menu no longer appears. The conditions set for it now returns false. I can just rename the Title. However, the URL would still show ../Members/..
Is it possible to change its id without issues or is this hard coded? I am expecting that I can just change the value of an attribute.
This is possible. You will need to make changes in the ZMI to the portal_membership tool.
It expects the folder to be called "Members". In the screenshot below I have customized my system to look for a folder called "Persons".
Related
We're creating a database of files on a new Plone 4.3.2 website, using eea.facetednav as the main interface. In order to have multiple searchable "tags" plus additional information like publish year, article type, etc etc, we've created custom Dexterity content types for these "files". One of the fields on the Dexterity content type is to upload the actual file.
Everything was going swimmingly UNTIL I realized...
One of the basic functionalities of linking to "files" is now broken. Whereas we would expect creating an internal link to a file will prompt opening the file or downloading it when clicked, now it just takes you to the "view" for the new Dexterity content type, where there's a link to the actual file.
This is pretty cumbersome. Has anyone done this before, or found a way to have it automatically link to download the file? If we need to disable/scrap the Dexterity content type view in favor of the direct link, that's probably fine, but bonus points if you can think of a way to make this work both ways (i.e. have a linking method that takes it to the file and a linking method that takes it to the view).
This is the page I mean by "view", in case it's unclear:
... Off the top of my head, I can think of a weird Diazo solution of making a custom template that parses this view and automatically redirects to the file link, but that seems wrong/weird. Other thoughts?
I'll go for the bonus points, though I haven't fully tested this...
First, you have to designate your file field as the content type's "primary" field. Unfortunately this option doesn't show up in the UI so you have to edit the XML version of the schema (there's a button for this in recent versions of the dexterity control panel). Add xmlns:marshal="http://namespaces.plone.org/supermodel/marshal" as a namespace at the top, and add marshal:primary="true" to the field tag in question.
Then, find your type in portal_types and change the "Default view method" to ##download. (It usually starts out as view for Dexterity content types.) This should make the item's URL download the file rather than showing the normal view. It knows which field to use because you designated it as primary.
You can still access the normal view by adding /view to the end of the item's URL. If you want Plone to do this when linking to the type from navigation and folder contents (just like it does for built-in images and files), go to portal_properties/site_properties and add the type's id to the typesUseViewActionInListings list.
If I had to solve this problem, I'd take the "link" content type view in plone.app.contenttypes as a model.
When someone asks to see a link content type object, the view looks to see if the requestor has the Modify portal content permission on the link object. If they do, they see the conventional view, giving them the opportunity to edit. If they don't, the view returns a redirect to the target URL.
Your code would be simpler. After checking the permission, you'd only need to append ##download/field_name to get the redirect URL.
Are there any existing solutions to this issue: a folder with a page as a default view turns up in search results along with the page if both the titles have the same term. I.e. two results pointing to the same place.
I think this is a likely scenario, since the item used as default view essentially covers the folder's name, description etc, it is likely that they are named similarly.
You can filter out such results by filtering out default pages; simply set is_default_page=False to your catalog query. Alternatively, don't include the Folder type in your search.
This would remove default pages or the folders altogether; you'd have to manually filter if you don't want to show both Folder and their default page results if both are present.
Plone version: 4.1.4
I have one folder containing 50 files. Author info can be shown through View--Display tab.
Now I hope to show author column in Plone's folder_contents page(Contents tab under the folder). How could I get that?
Best regards.
Hugo
The folder_contents view is not designed to be modifiable through the web (TTW). However, you can modify it on the filesystem (the easiest way is probably to override it with z3c.jbot).
Alternatively, you can simply create a Collection, which can show different fields, and use that as the default view of your folder.
You can use the plugin collective.listingviews which lets you make a new folder_listing view TTW.
A have a view created with Drupal's Views module, and have given it a Block display. It has the following fields:
first_name
last_name
professional_title
I understand that I can create a "[viewname]-block.tpl.php" file to provide a custom theme for this particular block, overriding the generic block.tpl.php template file. Within this [viewname]-block.tpl.php file, how can I pull out individual fields (eg, First name) so that I may theme them individually, giving them different classes? I've taken a look at $block, which yields $block-content, containing all fields, but this is as granular as I have managed to go so far.
Any help is appreciated.
Go into the Views UI and navigate to the block view you're trying to theme.
Under basic settings (at the bottom of it in fact) you'll see a Theme Information link. Click it.
I'm copying and pasting the official description of what that does:
"This section lists all possible templates for the display plugin and for the style plugins, ordered roughly from the least specific to the most specific. The active template for each plugin -- which is the most specific template found on the system -- is highlighted in bold."
So find the template for the field you want to theme and click the link for it - you'll get code to copy and paste. The code will be really generic, but there are notes in the generated tpl file about how to pull more specific object data.
Hope that helps
I'm having some problems creating a view for a node within my website.
The content has a path of 'content/%' where % is the title of the node.
What I tried to do is to create a page view in the Views2 module, but to no avail.
When I attempt to preview with the name of one of my nodes, nothing appears, and when I visit the node live, it renders text to the screen without any formatting.
Here are some of the settings from my View...please let me know if I should provide any extra information!
Page Settings
Path: content/%
Arguments
Node:Title
Title: %1
Action to take if argument is not present: Provide default argument
Default argument type: Node ID from URL
Edit
I will describe the behavior I'm expecting to see...
I have a list of nodes in my website in a view....that shows up without any issue.
What I would like to do is click on the node and go to that node's page, which is basically an expanded view of a single item from my list.
I thought what I could do is clone my list view and then add an argument to trim the scope from a list to a single item, but this isn't working too well. What is the proper method for styling a single node?
Edit:
Based on your edit, you've already used Views to create a list of nodes, and now you want to be able to click on one and get to the node page.
If you just want the default node output, you shouldn't have to do anything else. Don't try to use a View to override default node rendering; Drupal will print it out by default.
If you want to theme your node uniquely (beyond what moving the fields around and changing display settings in the UI allows you to do), then you should look at custom template files and theming. Resource here: http://drupal.org/theme-guide
You can change the default node.tpl.php file if you want to change how all nodes are displayed, or you can copy that file and rename it to node-name_of_custom_type.tpl.php to uniquely theme a custom content type you've created, but I'd suggest reading up on the Drupal theme system before making those changes.
End of edit
When you want to assign a path to a Views Page display, you shouldn't model it after any existing paths (e.g. node paths, as you mention). It should be something unique to avoid path alias conflicts. So for example:
my-path/%
Now, if you're just looking to embed a view inside of your node (and you want to pass along the node id as the argument), you're half-way there. Your Arguments setting, based on your description, is correct. However, you don't need a page display.
Here are a couple of options:
Quick 'n' Dirty: Create a block display (which doesn't need a path) and stick the block in a region on the node page (I've used the content_bottom region) to "embed" it in your node
Powerful, Flexible: Use the views_embed_view function (api docs here) inside your node (the body or a CCK field, just make sure to use the "PHP filter" input format)
If you use views_embed_view, you have the flexibility of sticking your Views results wherever you like, and you don't even need to create a Views page or block display, because that function can just use the "Default" display.
Note: If you export your View and save the export code on a site like pastebin or drupalbin, folks here can import the View and see it directly to help answer your question in full detail.
Okay, got it. :)
Using Node: Title as an argument is pretty tricky: with the default settings, the argument must match the title exactly. So, if you wanted to match on "Test value", your path would need to look like content/Test%20value (note the caps).
This will get you the node you want. You said you have default argument set to Node ID from URL; that really doesn't apply for Node: Title arguments. What it does is attempt to find a numeric Node ID and use that as the argument, which will never validate on a Node: Title unless the node's title happens to match the node's ID.
If you just want to display all the nodes if there isn't a title argument present, select Display all values as the action to take if an argument is not present. If you want to display all nodes if the title argument is invalid (like a typo or something), make sure Display all values is set in the Validator field group for the action to take if the argument does not validate.
Because of the exact match restriction on node titles, it's generally not a good idea to use Node: Title as the argument. Instead, consider using "content/NID", where NID is the Node ID of the row's node, as the link in the original view Then, instead of the Node: Title argument in your view, use the Node: ID argument. This should make it less error-prone.