Hi

Nice module

How do I hide or remove the group title under the link?

Pafla

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GStegemann’s picture

Very simple.

Goto to "Structure | Content Types | Web Links | Manage Display", i.e. /admin/structure/types/manage/weblinks/display on your site and set the field 'Web Links' to hidden.

Pafla’s picture

I have tried and make both label and format to "hidden"

Then opdate the site and the same, not hidden like the image.
Then i cleared all cache, and the same.

GStegemann’s picture

I just tested it. It works as expected.

Do you have any 'Custom display settings' on your site? Did you change the Standard Display settings? Or just 'Full text' and/or Teaser?

Pafla’s picture

What do you mean by "Custom display settings" - in theme or?
Using "MAYO"

Display URL/Visit on links page - is set to "No"

Link description display - is set to "Teaser length"

GStegemann’s picture

No, neither in the theme or the 'Web Links settings' page.

I mean on the 'Manage Display' page. At the end of this page is a link 'Custom display settings'. See also attached screen shot. Also on top of the 'Manage Display' page are tabs where you can setup different displays in Full or Teaser mode.

Pafla’s picture

Sorry.

At admin/structure/types/manage/weblinks/display i only changed the field "Web Links" and both label and format to hidden.
See screenshot

Under "Custom display settings" only marked "Teaser"

Pafla’s picture

FileSize
24.81 KB

Here is the screenshot

GStegemann’s picture

Have you tried to enable under "Custom display settings" also "Full content"?

Pafla’s picture

When i make the field "Web Links" format to hidden

And in "Custom Display Settings" only mark "Full Content" - not teaser
It fixed it then.

But what is the logic in that, make full content and display less?

GStegemann’s picture

OK.

I think it depends which component in Drupal renders the content of a node. When done by core the difference between full content and teaser is recognized correctly and the display settings are applied accordingly. It looks like that in Web Links a weblinks node on the Links page is always rendered like full content and the Web Links settings are just used internally to select how the description of a weblinks node should be displayed, i.e. full description, description truncated to teaser length or no description.

So I have to check if formatting of weblinks node on the Links page is not implemented as it should be done under D7.

jonathan1055’s picture

Title: Group » Hide or display link to group

I've just tested this (using the default Bartik theme) and it appears that neither the 'teaser' not 'full content' custom settings are respected when showing the main weblinks page. The link to the group is always rendered with the 'default' setting.

in "Custom Display Settings" only mark "Full Content" - not teaser. It fixed it then.
But what is the logic in that, make full content and display less?

@Pafla in #9 - when you tick the box for 'custom displays' that creates a new sub-tab where you can make further changes. What was the setting for weblnks in the 'full content' sub-tab? It might be that your theme (Mayo) does respect the setting, but my testing using Bartik did not. I'll might download Mayo and try it.

GStegemann’s picture

I've tested it with Pixture Reloaded and it behaves as described by Pafla.

jonathan1055’s picture

FileSize
70.84 KB

I've tested on Mayo and my findings are the same as my comment in 11. On the main weblinks page the nodes are rendered with 'default'. I found a very good way to check this is to use 'tokenised text' and set a label for each. See screen shot. Then it is really clear. In the Maybe Pixture behaves differently?

jonathan1055’s picture

I've done a full test of all the combinations, using the built-in Bartik and Garland themes and also Pixture Reloaded and Mayo. I used the trick of adding the display name into the tokeninsed label text for the link, to show clearly what display is rendering the content.

The settings I used in Manage display were :
default - link description set to default, both labels inline
full content - link description set to plain text, both labels above
teaser - link description set to summary of trimmed to 10, both labels hidden

Then in the 'Links settings' fieldset I tried each of the three options for Link description display

Link description display = No description
links page:
[bartik, pixture, garland, mayo] no description, link is rendered by 'default display', label inline (correct)
group page:
[bartik, pixture, garland, mayo] no description, link rendered by 'default display', label inline (correct)
actual node:
[bartik, pixture, garland] body and link rendered by 'full content', link label above (correct)
[mayo] same but link label inline
description is shown, and taken from full description field if there are two


link description display = Teaser length
links page:
[bartik, pixture, garland, mayo] description (trimmed to 30 if only one field, full teaser if two fields) and link rendered by 'teaser display'. no labels (correct)
group page:
[bartik, pixture, garland, mayo] description trimmed or taken from summary field, link rendered by 'teaser display'. no labels (correct)
actual node:
[bartik, pixture, garland] body and link rendered by 'full content', link label above. (correct)
[mayo] same but label inline


link description display = Full length
links page:
[bartik, pixture, garland, mayo] description is full text. Link is rendered by 'default', label inline (correct)
group page:
[bartik, pixture, garland, mayo] description is full text. Link rendered by 'default' display, label inline (correct)
actual node:
[bartik, pixture, garland] description is full text. Link rendered by 'full content' with label above. (correct)
[mayo] same, but the label is inline




I'm not certain that we actually have a problem. If you still think there is an error, please point out which of the above cases is wrong, and we'll go from there.

[edited to fix a couple of errors in my typing, not the results]

GStegemann’s picture

Thanks for your extensive tests and detailed test report.

I don't see a problem neither.

jonathan1055’s picture

To summarise my testing:

  1. Mostly everything appears to be working ok
  2. The 'no description' option affects the main links page and the group page, but not the full node (as expected)
  3. There must be some other setting to turn off the description/body label, as it was showing before but now it is never shown in my test site
  4. The links page is rendered by the default display when the link description display is 'none' or 'full length' but rendered by the teaser display if set to 'teaser' This will have other possibly adverse effects - the option only mentions how the description will be displayed. If we leave it like this, we should at least say something about the node rendering using this setting.
  5. Maybe we should add a 'weblinks' render mode (as discussed elsewhere) and change the form to show all the actual render options available, not a radio with effectively just the three core values. This would allow site designers proper flexibility
  6. The variable 'weblinks_linkdesc' which holds this value (currently none/teaser/body) is used in three places in weblinks.module - once in hook_weblinks_preprocess to derive a value for $variables['weblinks_body'] and in two calls to node_view($node, $linkdesc); when creating output for the main page, group page and user page

So it seems that this option is used for more than one purpose, and that could cause confusion (it certainly took me quite a while to get it sorted). Just opening the discussion here on the best way to proceed.

GStegemann’s picture

My notes.

  1. Yes.
  2. Yes.
  3. I think in Manage Fields - Display Fields.
  4. Correct.
  5. An idea which can be discussed.

I discovered another issue: in blocks the setting "Show description" does not work as defined. "No" works. But "Teaser" not: even when selected the full description is shown in the block. Apart from the random block: there is the setting fully ignored. This block displays the links always with no description.

jonathan1055’s picture

Title: Hide or display link to group » Separate 'Link Description' and 'View Mode' settings
Status: Active » Needs review
FileSize
4.2 KB

3. I found out why the label for the link description (body text) is not shown. It is because we render the weblinks body via the weblinks-link.tpl.php template, which does not display the label. The value of $variables['weblinks_body'] is set in weblinks_weblinks_preprocess() and other values from the weblinks table (link status, click count, etc) are also rendered here. All of this together is what gets displayed as 'Link Description' as referred to in the Content Type Manage Display tab.

4, 6. To solve these problems the best solution is to separate out the two settings, and not use one to control more things behind the scenes. Hence here is a patch which adds a new 'View Mode' selection in the admin settings form. This is then used in _weblinks_links() and _weblinks_user() instead of the original variable. It is now clear what the two settings do, and the admin can have better control over the display of links. The view mode values should be 'default', 'teaser' and 'full' but currently we call node_view($node, 'body') or node_view($node, 'none'). These probably revert to 'default' anyway, so having a separate setting is better.

5. On reflection, the admin can currently use 'Default', 'Teaser' and 'Full Content' view modes. I don't think we need to make another one, as these are already customisable per content-type. Site designers who need more than these can create one or more additional displays via a custom hook_entity_info_alter() and the code change I have made will automatically include them in the drop-down selection.

I discovered another issue ...

That's good, but this issue thread is complicated enough already, so maybe you could open another issue? Happy to look at that, but I think it should be a separate task. Hope that's ok with you?

GStegemann’s picture

Your proposed concept sounds good.

I have tested the patch and found one problem. When clicking on link at 'You can customise the display at ' a Page not found error ist displayed:

Page not found
The requested page "/cm7/en//admin/structure/types/manage/weblinks/display" could not be found.

OK, i will create a new issue for the blocks "Show description" settings problem.

jonathan1055’s picture

Glad you like the proposal.

For the 'not found' page, on line 312 of weblinks.admin.inc I had an extra / at the start of the url, which is wrong, but my browsers (both Firefox and Chrome) allowed it, and displayed the correct page, so I did not notice the error.

array('@link' => url('/admin/structure/types/manage/weblinks/display'))),

should be

array('@link' => url('admin/structure/types/manage/weblinks/display'))),

Can you edit this in your source code? I have fixed the source but won't upload a new patch just for this one typo ;-)

GStegemann’s picture

Status: Needs review » Reviewed & tested by the community

Fixed the source. Tested and works.

  • jonathan1055 committed 75b75dd on 7.x-1.x
    Issue #2201861 by jonathan1055: Separate 'Link Description' and 'View...
jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Good stuff :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.