As i have searched all over the place it even crossed my mind that it might even not be possible.
But on the other hand i cant imagine that it's not, looking at the amount of possibilities views 2 has.

Here is what i want:

1.create a blockdisplay (so far so good)

2.create a pagedisplay (so far so good)

3.create a link (not a "more link") in the block display that leads to the pagedisplay.(cant get this one right)

Comments

Anonymous’s picture

Have you tried theming your block ?

You could add a simple html link into the theme

Or and i have not tried this If the view footer is included in the block, you could add a link in there

WorldFallz’s picture

Views have headers and footers-- you could simply code a link to the url for the page view right into the footer of the block display.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

held69’s picture

Thanks guys for your interest.

The only theming i've done sofar has been to adjust the font size of some headers,
thanks to Dave ingram's great explanation: http://drupal.org/node/351543

Could you be a little more specific exactly where to put the url?

As i have four possible template files that come with the block:

-Display output
-Style output
-Rowstyle output
-Field Node: Titel (ID: title)

Which one should i open?
Once opened where should i place the html link?

Thanks
Byron

Anonymous’s picture

Assuming you are just wanting one link

go to your "Block" view

Under basic settings select "Footer"

Overide default

Type your link code and save

No need to even use the themeing options

(just tested it and it worked)

held69’s picture

Looks very good for a start, thanks.

As i'm testing, i noticed that when i insert a link in the footer and delete it (then saving it ofcourse).
The link is still there, i cleared the cache of my view but this didn't help.
Why is this?

Is this primary a solution for putting in one link, or can add as many i want here?

Thanks

Byron

Anonymous’s picture

A. Clear views cache
B. Check your vrowser is not caching the page
C. and least likely if you have a template that permits colour changing open it and then save againm as some info gets cached

held69’s picture

Thanks a lot for you clear and swift replies.

Anonymous’s picture

I forgot to say, you can add as many links as you like, though it would beg the question as to why ?

You can also just go to the Blocks section and add block to make your own and add whatever you like.

If you have a block with just several node titles, you can set those node tiles in the field settings to link directly to the node, so when clicked it opens the node in teh content area

You will find a million and one ways of doing things, and in all probability after 6 months, you will find a far better way of doing something for you, so if you can leave yourself room to manouver at a later date

held69’s picture

I understand.

I'm just kind of experimenting using the block display as a way to a create block menu for a specific groups.

I have been exploring with the node title as a link in a block. But couldn't figure out how to set a url for the link. I guess it does take some time :-p

For now your solution seems to work fine.

Allthough i'm still trying to figure out how to deal with the rowstyle in the block.
Choosing node is not an option as i dont want my whole node displayed in the block.
Choosing fields obliges me to display other content then just plain links.

For now thanks though,

you've been of great help

Byron

pjsz’s picture

If I understand your problem, I think you may be wanting to have one "View" with Page and Block views, where you have many columns on the page view but maybe only one piece of data for each node such as the title in the block view. Is that correct?

Well, you can do that. The trick is when editing the fields hitting the correct button -- ie the "Override" button before you hit the "Update default display".

Say you create your Page view first and set all your style to table and put all the fields you want on it. When editing properties, you will see "Override" in the top corner and "Update default display" in the bottom left which is the save button for those properties. If you hit the "Update default display" that is fine right now since this your first view and it saves this as the default display which is the template so to speak when adding another page or block view to this View. Until you hit "Override", you are changing the default display which is why the save button says "Update default display." So create the Page view how you want it and it is fine to save it all as the "Default" display.

Now add your block view and go to style and change it to "Html List" and click "Override" on the right. If you click "Update default display" you will change this property in the Page view as well which is not what you want. Many properties work this way. You will notice the caption on the save button and override button changes once you click "Override".

Now go to the fields section and click one and click "Override" again and make changes in the fields area for your block view.

You can enable the More link to go to the Page view you created or specify some other Page view if you created more than one. Make sure you click "Override" before saving in all places that you do not want to change the property on the Page view or any view using the "Default" display.

HTH

held69’s picture

Thanks for your broad explanation.

Combining block views and page views has not been a problem though.
The problem described above has a page display and a block display in one view.
Sorry if i haven't been clear on this.

My main problem has been how to create a link in a block display that links to a page display.
But i do have this solved creating a link in the footer of the block under basic settings that has the
same path as the pagedisplay.

The only question that is left is that i dont want any other content as these links in the footer.

Choosing for 'basic settings-rowstyle-node' or 'fields' will give me content unless i choose for a filter that blocks any other content. But to me this looks like a bit of an ugly workaround though..

Anonymous’s picture

Taking this bit

The only question that is left is that i dont want any other content as these links in the footer.

Choosing for 'basic settings-rowstyle-node' or 'fields' will give me content unless i choose for a filter that blocks any other content. But to me this looks like a bit of an ugly workaround though..

Not sure if i am reading what you say correctly but if you only need your block to contain a link to a view, then you could just as easy make your own block using Add Block on the views page and put whatever you like in the block

ALternatively if you really must have the block generated by the view but do not want the body and only want the footer, you can theme it and remove the body

held69’s picture

The reason why i've chosen for a block display instead of adding a block with 'add block' is that i want this block to show up only in the context of a group (og).

How could i remove the body.
I'm really not much of coder....:-)

Thanks so far.

Anonymous’s picture

could you not set a block to show only " in the context of a group (og)." using some php - search drupal for something like "block visibility based on xxxx" I had need for a block on several pages where it could only be done with php, and found clues here.

AsToRemoving Body, you need to theme the block, or set footer to display when views returns no results and then set a filter or argument to ensure it never will. Though this to me sounds messy and teh former would be better, as you also get to learn new tricks that you may need later

held69’s picture

could you not set a block to show only " in the context of a group (og)." using some php - search drupal for something like "block visibility based on xxxx" I had need for a block on several pages where it could only be done with php, and found clues here.

This sounds very interesting. I've been busy searching for the right formula for weeks now to apply this for a page display.
And ofcourse i could use this also for a block display. The problem is i can't seem to find the right settings or/and code with views and OG for Drupal 6 to accomplish group context for page and block displays.

Until now i have found some info about groupcontext related to page displays and block displays but mainly its meant for Drupal 5.
See http://drupal.org/node/369536 and http://drupal.org/node/361014

Anonymous’s picture

OK Winging it now :)

Not knowing how OG works makes it harder to help but I Assume the users have a specific "Role" ?

The following code may give some ideas

The first bit is supposed to make a block visible based on "My_Content_Type", though its not tested,

The second bits based on "Mypath"

It maybe possible to use something of this nature or adapt it for a "User Role". I would suggest for testing purposes when experimenting either a test site, A "Dummy Role" so that if it fails it doesnt make the site unavailable especially to yourself.

<?php
$match = FALSE;
$types = array('My_Content_Type' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
  if (isset($types[$type])) {
    $match = TRUE;
  }
}

if (substr($_SERVER["REQUEST_URI"], 0) == "/My_path1")
{ $match = TRUE;}

if (substr($_SERVER["REQUEST_URI"], 0) == "/My_path2")
{ $match = TRUE;}

return $match;
?>

Depending on how your OG is set up their may be a common path?

held69’s picture

Thanks!

I've pasted the first bit of code under the php argument code field in my block display in views.
It looks like it works, the block stays within the group context so far.:-))

I haven't tried the second part though.
Is the second part based on the path of my pagedisplay?
Its og/%/groupmessages.
Should mypath in the code be changed to og/%/groupmessages?

Not knowing how OG works makes it harder to help but I Assume the users have a specific "Role" ?

I dont know exactly how to apply 'role' to OG.
I do know that every group in OG is just a node, though i might be saying something that you know allready ;-)

Again, thanks a lot..

Anonymous’s picture

The reason i had for both parts of the code was i needed the block on every page of a content type and every page with a certain path. Its an either/or/both situation

if your path is og/%/groupmessages

you could just try the "og" instead of mypath, though rememebr if you have a path of "oggy" it may also be affected

if organic groups are a specifi content type and the first bit works, then just use that. It all depends on where you want the block

held69’s picture

That's what i will do really. Just to stick with this one. However i understand a great deal of what your saying about the second bit.

Thanks for your interest and support, i'll try and pass it on:-)

held69’s picture

i hate to be the guy that always has one last question, but after some solid testing i have one.

Is it possible to theme the block so that it will displayed even when it has no other content then the link, placed by myself, in the footer of the block?

I ask this because i want this link always to be displayed in the block, regardless of whether there is content to be shown or not.