Hey there,
When I display the output of a view as a page, I cannot see the contextual link for that view, but if I display the output of that view as a block, I can, indeed, see the contextual link for the view (the "edit view" link in the gear). If I set Bartik as the default theme, I can also see the contextual link in the view displayed as page.

Im working on a subtheme, with basically everything from the subtheme's original template.php turned off (as it is, all commented). Although if i set mothership as the default theme, I get the same result.

Bug, feature or am I doing something wrong?

Thanx in advance.

CommentFileSizeAuthor
#10 contextual-menu-fix.patch599 bytesbetovarg

Comments

jessepinho’s picture

As far as I understand, contextual links can only be attached to blocks (including the "Main page content" block). I don't believe contextual links can be attached to an embedded view.

betovarg’s picture

What do you mean by embedded view?

betovarg’s picture

I see what you mean, i though you meant embedded as in the tpl.php.

What I see is that, in Garland and Bartik, i can actually see the contextual link to edit the view. I dont know if it is something in that theme in particular...

jessepinho’s picture

Make sure you haven't disabled the block wrapper div in Mothership (I believe it's disabled by default) as that causes problems w/ contextual links as well.

serjas’s picture

Make sure

<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>

in your page.tpl.php

betovarg’s picture

Its weird because I can see the links markup in the inspector, but I cannot see the controls to edit the view, when the view is displayed as a page. I can use the controls in blocks, it is only in the view as a page.

Can you guys see those controls in a view displayed as a page, when mothership is on?

serjas’s picture

@betovarg , Another weird reason is presence of any wrapper div to your $content . Remove any div for $content

<div WITH SOME CLASS/ID><?php print render($page['content']); ?></div>

instead use print render($page['content']); only

quotientix’s picture

Status: Active » Needs review

In theme settings "Remove .view" needs to be unchecked - that should work to see the settings-wheel on the views again.

jamesharv’s picture

For me the contextual links were missing for 2 reasons:

  1. I was not printing the $classes variable for the page.
  2. I was not rendering the $title_suffix variable.

The title should be rendered as follows, and the $classes variable should be printed in a class attribute for an element which wraps the title. Eg.

<div id="page" class="<?php print $classes; ?>">
    <?php print render($title_prefix); ?>
    <?php if ($title): ?>
      <h1><?php print $title; ?></h1>
    <?php endif; ?>
    <?php print render($title_suffix); ?>
    ...
</div>
betovarg’s picture

Issue tags: +#manati #drupalcr #mothership
StatusFileSize
new599 bytes

@jamesharv: thank you for your observation. I managed to fix the issue adding the $classes variable into my

, like:
<div class="page <?php print $classes; ?>">

@serjas You're right, that seems to be the case, in conjunction with the absence of the $classes variable.

Basically, #7 and #9 fixed this for me. My concern is that the page.tpl.php from the original mothership, comes without the $classes variable. This should be fixed because it is very annoying.

Thanx! When I get several issues I have with mothership I will submit my subtheme and let you all know.

In the meantime, here is a patch

mortendk’s picture

an alternative fix added to the dev version today - its a rewrite of the javascript file & do not need to add a view class
this also fix the general issue around contextual links that dosnt work ;)

mortendk’s picture

Status: Needs review » Fixed
mortendk’s picture

Status: Fixed » Closed (fixed)