how to put the node:link token in the html a label? - drupal

i have installed the views and token module. i add a views field 'Node:Link' and check the 'exclude from display' option for the 'node:link' field and set the field first in the field order,now i want to overrite a views field.
i put this more >> in the rewrite the output of this field text box. but it can't work? [view_node] is the Node:Link token, how to make the more>> link ok? thank you

In the Node:Link field, enter more in Text to display: text box.
No need to put anchor tag just type [view_node] in the rewrite the output of this field text box.

Views has a built in way to make text link to other pages with tokens. I would use that instead of putting the anchor tag in the rewrite section. It's titled, "Output this field as a link"
If you're on Drupal 6 and you just want to link the field to it's node then just check the box "Link this field to it's node"

Related

How to add pre-made text to a form with a button click from another page? Wordpress Elementor

I have a home accomodation website and it has a page with all the rooms and another one with contact info and email form. The page with rooms has a "Book" button under every room. My idea was that when the "Book" button is pushed than the wepage automatically goes to the Contact page and room info is submitted to the email form. For example when i press the Book button under 3-people bedroom than the text "The client likes to book 3-people bedroom" is added to the email form. I am using Wordpress and Elementor builder for my page and Formidable for form.
I think you could even do this simpler then the suggestion of Umair by indeed adding a parameter to the url. But then istead of using the echo, you can easily retrieve the values by adding the following code as default value in the form [get param=parameter]
So in your example you would create three buttons with following url
https://example.org/contact?room=room1
https://example.org/contact?room=room2
https://example.org/contact?room=room3
On your contact form choose the field in which you want to show the text and add as default value
[get param=room].
Obviously you can change the text after the parameter 'room=' in whatever you want.
Hi Yes you need to add a get request url (https://testdomain.com/formpage/?formtext=formtitle) of this button so when the user click on the button it will redirect with the get request url like this https://testdomain.com/formpage/?formtext=formtitle
then you can add this variable echo where ever you want to display this text also in the fomidable form also have this variable option to place in form.
so your form will be display with the selected text by default.
if( $_GET["formtext"]){
echo $_GET["formtext"];
}

Drupal 7 webform: How to change label of the field that was created by "Webform Dragndrop" module?

I am using the "Webform Dragndrop" module to add a drag-drop field to my webform. I need to change the label as follow:
enter image description here
I have tried form alter hook, but the label is not in the $form array.
Could anyone help?
Module Webform Dragndrop allows you to set Drag and drop upload text so you don't need to customize code.
Go to Configuration > Content authoring > Webform dragndrop settings and change the value to what you want:

WP Conctact from 7 hook - add additional mail is chekbox in form is checked (wpc7)

I have Contact Form 7 in my WordPress. The form has two text boxes and one checkbox. How can I send a copy of the letter, if chekbok selected? Perhaps there is a hook, which allows you to do this?
I believe you can accomplish this by editing the form tag, of course in your case you would edit the checkbox form tag and not the select form tag shown below :
[select your-recipient "CEO|ceo#example.com"
"Sales|sales#example.com"
"Support|support#example.com"]
and then editing your mail tag like so:
[_raw_{field name}] ([_raw_your-recipient]
For a more in depth explanation check out this link: https://contactform7.com/selectable-recipient-with-pipes/

collective.listingviews:how to use custom fields to display dexterity based image field and richtext field

I'd like to use the collective.listingviews controlpanel to display an image and richtext field. I have the image field working but would like to know if there is a simpler way to retrieve the image. When I try to retrieve the richtext field I end up with a permissions error.
The details:
I have a custom dexterity content type (examplecontent) and a collection which retrieves these examplecontent types.
To display the content types I've created a custom 'listingview' for the collection, the goal is that for each retrieved item the following should be displayed:
A RichText Field named 'body'
An Image Field named 'screenshot'
This is a mockup of how the layout might behave:
To retrieve the image field I'm using the custom tal expression:
python:"<img src='%s/view/++widget++form.widgets.screenshot/##download' />" % item.getObject().absolute_url()
To retrieve the body field I'm using the custom tal expression:
python:item.getObject().body
The image field is working but the richtext field gives the following:
RichTextValue object. (Did you mean .raw or .output?)
When I change the tal expression for the richtext field to the following:
python:item.getObject().body.output
I then get the following permissions error:
Insufficient Privileges
You do not have sufficient privileges to view this page. If you believe you are receiving this message in error, contact the site administration.
First off, you should change
python:"<img src='%s/view/++widget++form.widgets.screenshot/##download' />" % item.getObject().absolute_url()
to:
python:"<img src='%s/view/++widget++form.widgets.screenshot/##download' />" % item.getURL()
Since this way means you don't have to get the full object. Note the use of the getURL() method.
For the second expression, try something like this:
item/getObject/##text-transform/body
or
python: item.getObject().restrictedTraverse('##text-transform/body')
untested

How to create a read more link in Drupal views?

I am facing a problem in drupal views, i want to show the node body 400 character and add a read more link on after trimming. So I have trimmed the node body 400 character and put the "More link: Yes" on views. I can see the ellipsis(... after words) but not showing the link. What is the procedure to add a read more link? I am using drupal 6.22 version
Thanks in advance
A More link set to yes will send a user to a page view of that view. My typical approach to the more link is to add a field to the view for path. Then I set the path to be rewritten as More ยป.
Having the path field a the end of the view (Or at least after your body field) will give you the results you're looking for.
This is how I had done it.
In the edit of my view, I added a field node:link.
Then I removed the Label and left it empty and added "Read more" in Text to display
I checked the checkbox Trim this field to a maximum length, entered my maximum length in the textfield and checked the Add an ellipsis and Trim only on a word boundary options.
Click on Update button and save the changes. You are done!

Resources