I have defined a content type in dexterity that has a number of RichText fields in it, and this was working fine. I then added collective.flowplayer into my install. This seems to add an adapter so that it can detect if content has an audio or video player div tag embeded in it, which all makes sense. But now I can't edit or create an instance of one of my dexterity types. The adapter throws an exception complaining that the type cannot be adapted to IPrimaryFieldInfo, and the dexterity content type cannot be saved.
Taking the clue from another SO question, I derived the dexterity content type from both plone.directives.form.Schema and plone.rfc822.interfaces.IPrimaryFieldInfo. A different exception this time in collective.flowplayer.dexterity's update_media_info function, which I could work around by changing:
if info.value is not None:
to
if hasattr(info, 'value') and info.value is not None:
which is a bit too hacky for me to be happy with.
Is this a known problem, or is this just some versioning nightmare?
Related
I have already received some help on this from other posts in StackOverflow, but there is a specific refinement that does not seem to be addressed.
I cloned a Drupal Site.
Everything seemed to be working just fine as I worked on CSS per client request.
Then along came a client request that involved changes to the fields in a View. No custom field was available in the dialog box - only the default fields. An error showed up at the top of the page: Notice: unserialize(): Error at offset 421 of 16415 bytes in views_db_object->load_row() (line 2251 of /var/www/sitename/html/sites/all/modules/views/includes/view.inc).
There had been a change that affected Content Types, but I did not realize that one bad View would cause all of them to fail.
It was suggested that I look at another StackOverflow question about this error. One reply said to remove potentially problem Views. When I did that, the error went away.
I can now make new Views and have a list of all the available fields, but once I save the View, it goes back to only showing the default fields. There is something else wrong, but I don't know what it is.
Drupal is always a new puzzle to solve!
I have a list of pages that have to appear in different places of my Plone. If I use an internal link, I see an HTML link in the page but instead of that I would like to see the embedded content of the linked page.
I've tried to install some link plugins (Smart Link, vs.alias...) but I'm not able to find the solution.
I'm using Plone 4.3.
I don't know any Plone Plugin, which satisfy your requirement.
A long time ago i wrote this small js to show internal links in a popup using Plone's prepOverlay.
In this case you can put a popup custom CSS class on the internal link with TinyMCE.
It simply shows the content area of the given URL.
$(function(){
jq('a.popup').prepOverlay({
subtype:'ajax',
urlmatch:'$',urlreplace:' #content > *'
});
});
I guess this is a good starting point for your own implementation.
You could think of a criterion like location, contenttype, etc., to distinct, which articles should be picked (in worst case use collective.flag), then fetch them with a collection, to give you the links as a resultlist, and set its view to all_content, a nice feature, introduced in the Plone-4 series.
I need your help for a problem that seems childish but that I can't solve.
I would like to activate a block (that is already activated for other content-types pages and works just fine) to show it up on a new content-type. I just checked the box in admin->structure->block->configure->visibility parameters for that specific content-type just like I did for others. However, it doesn't show up.
Here is a screenshot of block parameters config (you never know ^^).
This block is located in sidebar_second region. So I checked with dpm() if this region was set in both content-types.
Here I can see that is actually set for my content-type basic page where the block shows up well.
But here I see that my region doesn't exist at all and thereby my block doesn't appear.
I created a new test block and located it in sidebar_second region as well to determine if the problem is the specific block itself or the content-type page... Apparently, I guess it is the second solution because it doesn't show up neither.
Also, I tried to locate my blocks into the sidebar_first region (that already exists for my content-type testimonial). Unfortunately, it doesn't work neither. Of course, it works well on content-type basic page...
To make sure the page code is not overriden in my testimonial.module or template, I checked twice the hooks I implemented and all my templates files... I found nothing that could cause that problem.
Eventually, I googled my problem and found that bug report (closed because cannot be reproduced): https://drupal.org/node/1777072 but I think that it would be very unlucky as it happens...
To choose, it surely is a mistake that I don't see rather than an uber rare bug that happened to 10 people in the world xD
That's why I need your help, รด stackoverflow people!
My first though it that the testimonial content type could be using a different page template to the basic page content type.
You will need the line:
<?php echo render($page['sidebar_first']); ?>
In the page template used by testimonial.
Hmm, actually I'm not at all convinced that this is the correct solution but I'll post just in case it helps...
I just wanted you to know that I figure it out.
Indeed, my function hook_node_view() implemented menu_set_active_item("testimonial") to solve a navigation detail (to force highlighting a menu item...). However, it modified the q variable in URL and Drupal didn't know anymore that the page was actually a node type testimonial (and thought it was actually a View).
Thereby, my block couldn't appear because it was supposed to show up on node type testimonial (and not on a View).
So, I had to save the true nature of my page in a variable using menu_get_active_trail() before implementing menu_set_active_item().
Eventually, I had to pass this variable in my hook_block_view() to display the block.
I am sorry for not having given you all the information that was necessary to answer my question. I thought the custom code wasn't very suspect but I was wrong. I'm still a junior Drupal developer and I didn't know what menu_set_active_item() method did exactly. Thanks however and have a great weekend!
I'm looking to create an SDL Tridion schema with a list of repeatable links while avoiding multiple fields per link.
Hyperlink
In a rich text field I have the following options for creating a hyperlink:*
Component
Anchor
http://
mailto:
Other
When content authors create one of these hyperlinks, they have the option to select linked (visible) text as well as title and target attributes that function like typical HTML hyperlinks.
"Richtext" means a Text field with Height of the Text Area = at least 2 rows with Allow Rich Text Formatting selected.
Single Schema Field Link
When creating a single schema field, I see these options:
External Link (author options will include http://, mailto, Other)
Multimedia Link
Component Link (which can allow Multimedia Values)
Current Ideas
The best out-of-the-box (OOTB) setups I've found for this "list of links" is either offering:
a single 2-line RTF with instructions to create a hyperlink (of any type) in that field
separate fields for each type as well as additional fields for display name, target, and title (where the fields are assembled through template code), authors fill in only one of the fields (component link or external)
Question
Is there a way in the schema form designer, by updating the schema source, or through code to offer the same (RTF) hyperlink drop-down options, but in a single field? I could be missing something, but recognize this scenario isn't supported OOTB.
One question we are missing here is to consider if those links are going to be used somewhere else individually. If that's the case, multiple components would be my first choice, so we can reuse each component several times.
If you are planning to allow the editor to create a list of links that they are only going to use in a given component (not reusable), well, you have all the options mentioned in the previous answers.
To give you an idea on what's the best approach (in my humble opinion) here are things to consider:
Individual Components per link: use this approach if links are reusable.
Using embedded schemas (with the link structure) so this approach can be used in different component types (schemas)
Custom URL / Single Line Text Field: it requires an additional development effort and it is very unlikely you will keep the hard-link-references when creating internal links. As you know SDL Tridion keeps a reference to the tcm id in order to resolve links, trigger publishing, etc..
Custom URL / 2 Lines RTF: It will do the job, but you need to make sure you disable all the other RTF options from the Ribbon Tool Bar within the Schema RTF options, so you meke sure that the editors can only create links. Also, you might need to consider to add an XSLT filter to check if the edtiors entered something more than just links. These links are not reusable.
In general if you implement something custom (GUI extension + Custom URL) keep in mind all the TRIDION CMS concepts, like blueprinting (what happens when the link is inherited down), where used, etc...
My recommendation has always been to use Separated Components, but be careful with the link propagation when publishing...
I have seen this case at customers. If they consider less development effort, the idea of having a multiple embedded field is good.
You can have it as:
[text] Link Text
[Component Link] Link to anything
You would need an extra Content schema for External Links, like:
[External Link] Url
[text] target
[any extra option you need]
This means the editor would need to create a new External Link Component every time they create an external link. It is extra work, but it can also mean easier maintenance on the use of external urls within their site.
Lastly, the editor would just add multiple Component Links, those being of schema External Link of any other. It will be the template code which checks on the schema of the linked Component and add the code accordingly.
XML Name Description Field Type
[text] Text Text
[title] Title Text
[static_url] External URL Text
[component] Internal URL Component Link
In the field description for "External URL" and "Internal URL" you could add a comment to make sure that the editor doesn't get confused, only one of these two fields should be filled in. From the component, its ID can be used to create the dynamic link in the DWT. This solution has no development effort and for the editor is pretty much as intuitive as it can get. Of course this would be a multivalue embedded schema field inside the Links schema.
This use-case might work using a Custom URL field and maybe a GUI extension. The idea is to have a Custom URL that opens a popup (which might be a GUI extension). In that popup, you would select/construct your link (maybe using the same options as a normal RTF link - Component, Anchor, mailto, etc).
The popup would return a specially crafted string. The format could be anything, even an actual anchor tag (but JSon is also fine). Example: {href:'tcm:1-2',type='component'}.
Your Templates would interpret this string in order to generate something meaningful, like a dynamic link or static HTML anchor.
Also the Custom URL popup should be smart enough to 'decode' such a link (if a value was specified in that field previously) and maybe pre-populate some attributes in the RTF link constructor form.
I have just installed dexterity into our office's intranet site so that I can create some new types for particular styles of documents. I had hoped just to use just the TTW capabilities, but I'm seeing extraordinary behaviour. When I try to create the fields of a new type, any, or all of the following problems can be seen, almost non-deterministically:
After saving the attributes of a new field, the field sometimes doesn't get shown in the page showing the fields of that new type.
Sometime a page refesh does show it, other times it doesn't.
Clicking on the Settings for a field (when it is visible) sometimes shows the error dialog indicationg that this page does not exist.
Sometimes the settings dialog does come up, and then attempts to save it fail with another error dialog to say that this page does not exist.
With a bit of persistance by retrying and refreshing often, I can get a type defined with a couple fields. Then when If I create an instance of this new type, often only some subset of those new fields are shown in the creation form. When I try to save it, the form is shown again but this time with the required fields that were originally hidden now highlighted in red. Finally saving that object then displays it with some fields (but not all) missing.
It's seems utterly random.
I have added the following to my buildout:
extends =
base.cfg
versions.cfg
http://good-py.appspot.com/release/dexterity/1.0.3?plone=4.1
...
eggs =
...
plone.app.dexterity
My Plone is:
Plone 4111
CMF 2.2.4
Zope 2.13.8
The event.log doesn't have any messages in it when these problem are occuring.
Any insights appreciated.
Do you have a caching server in front of Plone? Maybe that is being too agressive and it is caching stale content. Try accessing Plone directly without any caching servers in between and see if that helps.