Drupal: How to Figure Out the token for a Specific Field? - drupal

I would like to know how to 'construct' tokens. I have read many examples, but somehow I don't understand them. I am new to Drupal and at the moment I am testing how it works. I'm trying to hide the title of a content type I've created and automatically replace it with the content of another field. As far as I know, I have installed and enabled all the relevant modules including CCK and Automatic Entity Label. The only thing I don't know is what token I should use to make it happen. The field I would like to use as the source for the title field is called event (or possibly field_event) and is of type text. I'm visually impaired and either I'm doing something wrong, or the token browser is not too screen reader friendly. Either way, I can't access the list of all tokens to select the token, so I have to enter it manually. If I'm not mistaken, the token should include '[node:body]', right? But is it like '[node:event:body]' or '[field:event:body]' or something else?
Many thanks!

One Idea might be the devel module https://drupal.org/project/devel . Install it, activate it and visit some page of the node type you want to use the token on, and click on the devel tab and then on the token tab. et voila. or you navigate directly to e.g. yoursite.com/node/29/devel/token .
Hope it helps.

Related

How can an input and output show linked in BizTalk and not have a connection?

I need to add an extra field to a BizTalk service call.
I added the field as an element in the input and output schemas.
Then I was going to map the input and output in the mapper.
But I was faced with this:
The old fields show as linked and they are working. But there's no visible link. I would like to add the new field and map it the same way and not link it directly.
Anyone knows how this can be linked?
I searched for the old fields in the solution and I couldn't find anything that could explain this. I guess there must be some property I don't know about but I don't see anything either.
The link is done in another page. I forgot you can scroll through pages in biztalk mapper

How to add a bespoke social sharing message to a specific page

I've used services like 'Add This' for a while but now I need to add a couple of specific bits of functionality to an ecommerce order completion page. It's to work like Amazon's order thank you page where it allows you to post a message to Facebook saying something like 'I just bought a widget on Amazon'.
Equally I'm looking for the equivalent in Twitter.
I've added a bunch of OG tags and share buttons but can't get it to do what I need. From further reading it sounds like I might need to create a Facebook app of some sort and use FB ui to create the link to post to the user's wall. I was hoping to do this without getting tangled up in that level of permissions etc but maybe that's not possible any more?
This is being developed on asp.net C#, in case there's a library that I haven't found in my searching.
Can anyone familiar with this type of development point me in the right direction?
For Twitter, the simplest way is to use Web Intents.
For example, if you want to share the text
I love http://example.com
URL encode the text to I%20love%20http%3A%2F%2Fexample.com and use the Twitter Web Intent URI. E.g.
https://twitter.com/intent/tweet?text=I%20love%20http%3A%2F%2Fexample.com
When the user clicks on that link (try it!) or is directed there by your service, they'll be prompted to share that text.

Plone: Email contents in content rule action

I have a Plone site configured with PloneFormGen. I'm using a save-data-to-content adapter to create a page for each submission, with a unique number for title/id. I have content rules set up so that various roles will be notified when a submitted form transitions along the workflow.
Is there any way to include the content of the submitted in these emails? I know PloneFormGen can send the content of the form in an initial email at submit time, but I need to send this same information later. I'm pretty good at figuring things out, but I'm no Plone expert so any help would be appreciated.
Additional info:
I'm using the uwosh.pfg.d2c adapter to perform the PFG -> Contenttype conversion, which works well. The content type is set to 'page' in the settings for the uwosh.pfg.d2c plugin. Content rules then will send emails to various groups or roles based on a state transition of the resulting content, which works in the normal way - when a transition occurs, the rule executes.
Effectively, what we have is pages that are being generated by the form when the user clicks submit. This is done through a plugin in PloneFormGen. This may provide some extra info: http://pythonhosted.org/uwosh.pfg.d2c/ - I'm not, admittedly, much of a developer.
Ideally, reviewers would get body-text of the created page when the form is submitted: this is done through a content rule that when a page is added to a folder, it sends the email. The page is added to the folder when the plugin in PloneFormGen creates the page.
When we have these pages, other users can come in and review and change the state of them - just as you can with any other page in Plone. PloneFormGen should have no further use once it's been converted to a page. Hope that helps.
The bad news is that this will require programming; the good news is that it won't take much. There are two reasonable approaches to solving the problem:
Have your content rule action run a script that handles the mailing itself. You can use the site's mailhost to send scripted mail; or,
In a Python package (no way to do this in a through-the-web script), provide a named adapter implementing plone.stringinterp.interfaces.IStringSubstitution for your context's text attribute. That will give you a $ substitution for the body. This would probably require less than 10 lines of total code.
You might want to have a look a collective.contentrules.mailtogroup, the newest version is capable to send the body-text as mail (use the '${text}'-variable), triggered on one of the convenient content-rules-events, in your case 'Object added'.
You can assign your roles to a group and use it for your case.

How do I allow users to display LinkedIn profiles on my site?

I have a site (using PHP and JavaScript with jQuery) which allows users to display a profile, and I would like them to have the option of simply importing their LinkedIn profile, if they have one, rather than having to type everything in again.
I'm not sure what the best approach is here... I've read some of the LinkedIn API documentation, but I'm not even really sure which bit I need to look at.
The process should be:
User goes to profile management page
User is shown a checkbox saying "use my LinkedIn profile", and a textarea. If they don't want to type their profile into the checkbox, they check the checkbox, and somehow their Linked In profile is retrieved.
The LinkedIn profile is stored (or some kind of id is stored), so that the profile can be retrieved by anyone else at any time.
I'm not very familiar with the LinkedIn API, or with the site itself, so I'm not even sure what's possible. Does this sound possible, and if so, where do I start?
You can start with the User Profile tutorial here:
http://developer.linkedinlabs.com/tutorials/jsapi_profile/
The example uses jquery so it should be pretty easy for you to extend this to do what you want.

Add dynamic URL (or button) to each node in Drupal

I've used CCK to create a 'Travel Offer' content-type which basically just lists the details for a travel package.
My question is how to have a button or link on each node (when the user views it) that will link to a url that includes the title of the current node (eg: example.com/requestQuote/Title_Of_This_Node).
I haven't implemented my system yet so I am free to change the content-type to include a button field or something like that...
The easiest way to accomplish this would be by adding a node-your_content_type_name.tpl.php file into your theme folder. (If you haven't done this before, all you need to do is create a duplicate of node.tpl.php and rename the copy to node-your_content_type_name.tpl.php)
The '$title' variable is available within the node template, so it should be easy to craft a little bit of PHP to print out the appropriate link target.
Edit:
Now, if you want to get a little bit fancier, you could build the link to reference the unaliased node page ('example.com/requestQuote/node/11569' or whatever) and feed it through Drupal's handy l() function to build the hyperlink.
The advantage here is that you won't need to worry about the link changing if the title changes, even though l() will automatically update the actual hyperlink that's displayed to the user.
This will probably make the custom coding on your 'example.com/requestQuote' page a lot easier too, since you can work directly with the node ids and don't need to parse titles.

Resources