Drupal Text Block - Change on Per page basis - drupal-7

Is there a drupal block module that allows you to change the text of the block on a per page basis with the option of a default text for every page?
Thanks in advance

If you want different text in a block on a per page basis, one way to do this is to add a textarea field to the node for that page, and when block is rendered, look up the node for that page and pull the text from that field into that block.
It looks like this module does this for you:
https://www.drupal.org/project/cck_blocks
Here's a tutorial on how it works:
https://www.ostraining.com/blog/drupal/cck-blocks/

Related

Drupal 7 Views related query

I have a Page and a Block both are created using Views.
I want to display this Block along with the Page i.e. on Left hand side, Page's content will be shown and on the Right hand side this block's content but at the same time I don't want to configure this block from the administrative settings. How can I achieve this ?
You can create 'page' template file for your view and use module_invoke() function to call your block into it.
Page template can use following pattern -
page--[path].html.twig
module_invoke() documentation -
https://api.drupal.org/api/drupal/includes%21module.inc/function/module_invoke/7

Drupal 7 Multistep forms - Remove save & preview button until last step

I have made a multistep/page form in Drupal (the field type is a multipage group, with multipages nested).
The form is 6 pages, and there is required info on every page. The problem is, Drupal puts a "Save" and "Preview" button on the bottom of every page of the form. Really, you CANNOT preview the form or save it until all required fields are filled out. So when users are going through the form and they hit "save" halfway through or "preview" halfway through, they get a ton of errors.
Is there any way to remove the "save" and "preview" buttons until they are on the last page (i.e. page 6 only)?
Thanks.
EDIT: I am using Field Groups to build my form by the way.
There isn't any module I found to do this, not in it's entirety anyway.
We ended up removing the preview button completely with CSS, and installing a module (Required For Publishing) that allows you to specify "Fields Required for Publish" vs fields required to save a draft. Now there's only 3 fields to save a draft for later, but 20+ fields required to publish the event/form.
We used javascript in the multipage.js form to validate on each step so they can't move on without filling out the actual required fields on each page.
You'd have to make your own module and use hook_form_alter .. https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_alter/7 .. and check which step you are currently on .. and then remove the buttons if you are not on the last step .. and enjoy.
Something like .. unset($form['actions']['preview']);

Kickstart Price slider in front page

Can any one say that how i show my kickstart price slider in front page.
I read many reference but still at no where .
I use the multiblock module but the block produced is only shows in the search page.
Then I also try through view . I create another facet block using facet api but there is no option for changing the display widget.
is there any way or i am missing something .
Any help is most appreciable .
thank you in advance.
got it myself i create a facet block with price field and a search block of index type which will show the facet in every where the search page will shown .i restricted it for only front page .Then it works for me.

In Drupal 7 views how to give external link (another website) to a title?

Iam new to drupal 7 views.
I have a content type contains title, description fields. I want the content title's to scroll at the top of the page, so that i created a view and it works fine.What is my question is, i want to link a content (eg: 1st content (title) in a scroll) to another website instead of content page, the remaining contents linked to the content page. Is it possible?.If it is possible how it can be done?..
Thanks in advance,
A.John Melchior.
Yes, it's possible.
One way to do it, would be to use the Link module to create a link field in your node.
Use the link field to input the external link value.
In views add the link field, before the title ( order is important ) and exclude it from display
Add the node title field in the views and in the rewrite field output option, use one the link field token as your path.
I'm not looking at the Views UI right now , but you should find at least a couple of ways to redirect content when the node title is clicked. You should have the Rewrite field output and the Output this field as a link.
You could make use of Display Suite coupled with the description above.
Create a link field for your nodes.
Create 2 view modes for your content type via Display Suite. View Mode 1 will show the link field as the first data element, View Mode 2 will show the title as the first element.
Configure your view to show output using Display Suite, configured to show the first record using View Mode 1, all others using View Mode 2.

Views Content Pane "Related content" by taxonomy

I'm currently developing a Drupal 7 site where I use Page Manager's "node_view" to customize the layout for my "Article" content type.
So, whenever viewing an Article I want to show a little box with "Related content".
I have a taxonomy vocabulary "Shared category" that I use in all my content types.
For example I also have a "Gallery" content type, so when viewing an article in with the "myTag" term - I want to show a Content Pane with images tagged with "myTag" from the "Shared category" vocabulary.
My question is about setting up the Contextual Filter for the Content Pane.
Should the "Argument input" be a Vocabulary or a Term? - I've tried both but can't get it to work.
Also I have another question: Is it possible to use a Content Pane as a block, that is shown with the Panel? - I guess not, sinse the Contextual filter value comes from Page Manager.
You won't want to manually input the argument in the panel, as it will vary for each article.
You'll want to set it automatically using a default argument that gets the tid from the node.
To get the related content block to show content based on the same terms as the node being viewed, you'd need to add a taxonomy term id argument to the view.
You can then try the 'Set a default argument' and use 'taxonomy term from URL' ( node option )
If that doesn't work, you may need to get the relevant tid from node using php code in the default argument area, with something like node_load or menu_get_object to load the node.
e.g something like
if($node = menu_get_object()){
if(isset($node->field_shared_category[$node->language][0]['tid'])){
return $node->field_shared_category[$node->language][0]['tid'];
}
}
Related content can be shown by using contextual filter in block views. This block view will contain content which are associated with the current content viewed by a user.
You can goto "Create related content block view based on terms in Drupal 7" blog post to get step by step instruction to create this block view.

Resources