Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to build a portal site using IPE. There's a situation where we would like to override the panel title to make it shorter than the article it is linking to. "Link the node title to the node" by itself works great and presents the longer worded panel title when it is enabled. "Override Title" by itself works great, allowing me to use a custom panel title. The problem is, when I try to enable both of these options, "Override Title" takes precedence but the panel title is not linked to its node. Is there a way to get these two options to work together?
Comment | File | Size | Author |
---|---|---|---|
#7 | _1149778_3.ctools.node_override_title.d7.patch | 763 bytes | jonathan1055 |
#3 | _1149778_3.ctools.node_override_title.patch | 763 bytes | jonathan1055 |
#3 | screen shot of code lines changed | 128.33 KB | jonathan1055 |
Comments
Comment #1
janyo CreditAttribution: janyo commentedYeah, getting the same problem. I assume that technically it is not the node title anymore that is displayed when an "override title" is in place, thus the "link node title to its node" doesn't apply anymore. At least that's what I'm reading out of it ;-)
I think it would be beneficial to change this feature into a generic "Link title to its node" which could work in either case, if it's possible to do that... Thanks!
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedYes I am having this problem too. I will also try to find which bit of code is causing it.
Jonathan
Comment #3
jonathan1055 CreditAttribution: jonathan1055 commentedHere is a patch to /modules/ctools/plugins/content_types/node/node.inc on the D6 version.
The trick was not to create the actual rendered active link here, but set title_link to the required url, so that the calling function ctools_content_render() can create the link there, which it can do already, but crucially it does it after the override title is used if required. This has the added benefit that keyword substitution in the title now works correctly on just the text, not the rendered link (which would sometime cause mal-formed html tags)
If it works ok, obviously I need to code the D7 version to be committed first. But given that the original post was for D6 I thought this would be a good place to start.
@jqt, @janyo: Please test and let me know how you get on.
Jonathan
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedForgot to set the status to 'needs review'. Let me know if you want/need a D7 version. I've not looked at the D7 code at all, so I've no idea yet if the same change will do it.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 commentedGuess it should really go into the ctools issue queue http://drupal.org/project/issues/ctools, given that this is where the code patch is required. The patch is against 1.8 but the dev version has not changed apart from the $id line being removed.
Jonathan
Comment #6
sco_tt CreditAttribution: sco_tt commentedConfirming that this works in Drupal 6 with Ctools 6.x-1.8 and Panels 6.x-3.9. Thanks!
Comment #7
jonathan1055 CreditAttribution: jonathan1055 commentedThanks sco_tt for testing it. I have now checked D7 and the same fault is there too. Luckily the fix is identical, and here is a patch against 7.x-1.x-dev of 7th January.
Jonathan
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to D6 and D7!