I need to setup a "section image" addable by a user.
The customer wants a different image for every folder placed in the top of the site.
These images can be added/edited by portal user.
Usually I add collective.contentleadimage to the instance. Then I create a new viewlet customizing the contentleadimage code using the aq_parent to have a "traversal way" for folders without a own "section image". In this way all the first-level folders can have a "section image" and the second one a "section image" inherited by the parent folder.
Is there a better way?
Vito
The "traversal way", as you call it, is the simplest option if you need that the image is modifiable by the customer.
Another option could be to rely on the portal_registry:
add an image anywhere you like
add an entry in the registry where you specify the location of the image for a specific section
Related
So I have a CPT named "Task".
In the listing page of tasks, I would like to display each task in a card where I can find the title of the task, plus two buttons :
one with a link to a template where I display some content A
one with a different link to a different template where I display some content B from the same Task.
Content A and Content B have some fields in common but also some specific blocks (texts, images, slider..)
In the administration, with Gutenberg how could I create blocks and be able to decide if it's for content A or content B or for both ?
I would have imagined like a system of "tabs". I click on tab "content A" then I add my blocks with Gutenberg, then I click on "content B" and then I can add blocks for it. But I have no idea if something like that exists.
If I'm not clear I could make a drawing.
Thank you in advance !
how can I add a "to the top" link at the end of a collection in plone?
This collection is in a collage. I thought of adding the article type "page" in a new row where I could use the HTML-Editor and use there an internal link to the top of the page.. But it seems inconvenient to me.
Isn't there a better way?
A very simple way could be using the Plone inner feature of the document_actions (a tool still available but not used anymore from Plone 4.0 and up).
Go to ZMI, access the portal_actions tool, the document_actions. Now add a new "CMF Action" from the form on the right.
The important information for you is the "URL (Expression)", that must be something like string:#youranchortarget. To fill every other field copy from existing actions.
If you need this link only for a content type or something like this, just play with the "Condition (Expression)".
Links inside this tool are displayed in the plone.abovecontenttitle.documentactions viewlet.
If you want the link on every "page" item, then you could customize the default view's template.
I've been struggling for a while with this problem and I'm curious if anyone has any thoughts:
I have two related content types on my website -- "Institutes" and "Projects". On a single Institute page I would like to display a preview of multiple Project content types that are related to that institute. This would mean for each preview pulling three fields from the Project page -- the main project picture, the title, and the project description.
Currently I have a "node reference" field on a Institute content type where you can select which Projects are related to the Person. Of course without Views it only shows the title of the Project. I just can't figure out how to use Views here to display the fields I want.
At this point I have a Block View with a Relationship selecting my node reference. I'm having trouble understanding how I can use that relationship to show fields of corresponding Project content types though.
Does anyone have any idea? I'm sure it's right in front of my face, I just need a push in the right direction.
Thank you so much in advance, to anyone willing to give advice.
-Maxime
Try this:
1) Create your view with the filter "Content Type: Projects" and configure the fields and display /style as usual...
2) Then add a argument of the "Institute reference field" or whatever you called on the Project page. Then set the default value of the argument to be "Node ID from URL"
When the block or whatever is displayed on a Institute page it will display the projects that reference it.
I hope I understood your question :)
I think you would have a user reference in your "Projects" content type instead of a node reference in "People" content type. Because you can create a view using arguments.
Try this things:
Delete the node reference in People.
Add a user reference content type in Proyecjs.
Create a view passing one argument: your user reference field.
Preview your view passing one example uid, i sure it workds.
I hope its useful.
Regards.
I would like to have a different image for the thumbnail than the what the customer sees when he clicks on it.
For example: In my color attribute I want to upload color samples and a preview of that product in that color. I'm sure this is possible somehow but I can't seem to find the proper module or feature. If I have to I will create the module myself but it seems like it should be something that would be in high demand so I can't figure out why I can't find something.
Start with the Imagecache module (http://drupal.org/project/imagecache), you can create a preset that will derive an image from another image field. You could then write your own image cache plugin that could generate a preview for a specified color.
I haven't played with Ubercart so I'm not sure if there are limitations of which I'm not aware, but you should be able to create 2 imagefields in your content type. One called something like "teaser image" and one called perhaps "product image". Set up whatever imagecache presets you need and configure your content type to display "teaser image" in the teaser but hide "product image" and vice-versa for the full node view.
I really like the promote to home page feature of drupal. But what if I want some content promoted to a page other than the home page. Is that possible?
The "promote to front page" is a helper that puts the page in the /node URL. If your front page is not /node, the "promote to front page" won't really do what you expect.
If you want a list of nodes, then views will do the trick. However, if what you want is to put a node in a page that is another node as if it was a block, then I suggest you look at the "node as block" module.
From the module description:
This module allows those with the appropriate permissions the right to create blocks for each node. By default these blocks display the node title as the block title and the node teaser as the body.
I would suggest using Views for this purpose. For instance, create a taxonomy vocabulary with terms corresponding to the various pages you might want content to be promoted to. Then create or edit that content and tag it accordingly. In Views, use the taxonomy filter to display only the matching content.
As often, there are many ways to do that. The Flag module is a good way to put all kinds of markers on nodes. Another option is the Nodequeue module. This module allows the content creator to group nodes in 'queues' and control the order.