Closed (fixed)
Project:
Shortcode
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2010 at 08:49 UTC
Updated:
30 Jul 2018 at 08:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
denes.szabo commentedYou just have to see into the shortcode module dir: there are two other module which use the shortcode api. These modules defines own shortcode tags.
You have to only enable the shortcode for your input format. It is not matter this input format uses tinymce or not, the shortcode will work. I use it with tinymce too.
I know I have to write a good documentation... This task in my queue...
Comment #2
brenes commentedThank you for your reply. By using the code in your shortcode_basic_tags.module as an example I figured out how to add shortcodes on a programmatical basis. As a future extension I could imagine that it would be neat if the user is able to add the Shortcodes in the drupal backend.
I think you misunderstood me with the tinymce implementation. I would like to add a dropdown (or anything else) to tinymce from which I can select the appropriate shortcode, which then gets inserted in the textarea. Or another Idea is that I have the shortcodes presented under the content field - like they are now through your shortcode_basic_tags.module - and when I click on one that it gets inserted in the content field. Because I think the copy and pasting of the shortcodes is to much of a hassle for a non experienced user.
Any Ideas?
Comment #3
denes.szabo commentedYou are right: boring and easy mistype the codes.
I think, there should be an interface for wysiwyg api and the enabled shortcodes automatically should insert themself into the content editors. But, I have no idea how it can be. I haven't seen the wysiwyg api yet.
I am thinking about it.
Comment #4
brenes commentedI have seen a similar function in a wordpress theme I used for a customer. They are using a custom Plugin for tinymce, so that you can add your shortcodes with a pulldown menue. Probably you like to have a look at the code. I attached the files as a zip and a screenshot of the interface.
Comment #5
denes.szabo commentedI see. I understand it, but I think we should only give an active shortcodes list only to the editors. And we should wrote a separate plugin for the editors. But first I should discover the wysiwyg api module for a clean way to communicate all editors. Not just only one, special editor.
I think, it is a big request, but it would be a nice feature.
First I will make it for the tinymce beacuse I am using it. :)
Comment #6
brenes commentedThat sounds like a good idea. Please dont't hesitate to contact me if you need my help for testing purpose.
Comment #7
jedihe commentedHi Denes.Szabo,
Probably you want to look at this: http://deglos.com/blog/2010/12/21/building-wysiwyg-plugin-drupal :)
BTW, your module is very nice, thanks for writing it!
Comment #8
jedihe commented-- duplicate
Comment #9
denes.szabo commentedThank you for your link! As I see on a first look, very useful tutorial!
Comment #10
scarmardo commentedI would like to convert a basic wordpress shortcode, but need an example of how it would look in the shortcode module.
How would I do this via the shortcode module?
This is what I would do in wordpress:
Comment #11
denes.szabo commentedHi,
I have made the quote plugin - it is in the shortcode basic tags module. Just enable it!
For all shortcodes I made help. You can see it on the help format section of the textarea. (http://yoursite/filter/tips).
It says:
The original wp's shortcode code not proper for us - I just use the "shortcode" idea and my code based on their code, but I quite drupalized it.
If you want any special theming for your quote you just have to only override this function:
But, I think you have to insert your quote as [quote class="pullquote_left"]My quote[/quote]
The quote markup automatically given the "quote" class.
Comment #12
erjenkins1 commentedHello. I'm hoping you can help me. I can't find where to input a new shortcode.
I'm trying to set a shortcode to display an author's specific ad (I do this for different authors).
Here is the code I use in Wordpress
function showads() {
return 'GOOGLE AD CODE HERE';
}
add_shortcode('authorname', 'showads');
Please help!!! This plugin appears to have the capability to do what I need.
Comment #13
denes.szabo commentedPlease, send me the google code, what should we insert as the ad html - or the google ad docs page.
But, it is easy task, I think.
Comment #14
infomance commentedHello and thank you. How can I send you the code?
Comment #15
denes.szabo commentedContact, issue and I have already sent you a contact message.
Comment #16
Docc commentedThese are 2 different issues(wysiwyg and shortcode api).
For 6.x you can look into the submodule shortcode_basic_tags on how to use the _shortcodes hook.
D7 version has an API file.
Comment #17
LaurenW commentedCan anyone provide more information on how to add additional shortcodes either programmatically or through the Drupal backend? It is not obvious at all for someone who does not develop modules. I really need one for buttons, but it does not seem to be an option when I go through the checkboxes in the text input format although I have Basic Shortcodes Library also installed.
Thanks,
Lauren
Comment #18
memoday commentedHi @Denes.Szabo
First, thanks for the great module. I am having hard time figuring out how to additional custom shortcodes. I would like to add Google Define to a node. How can I implement that in "shortcode_basic_tags.module"? Thanks in advance for your help!
Zeid
Comment #19
snarf1974 commentedHi @Denes.Szabo,
Like @Zeid, I too thank you for a fantastic module.
I was having trouble adding custom shortcodes but stumbled upon this great post by Brianna Deleasa:
https://briannadeleasa.com/blog/drupal-php/shortcodes-drupal-yes-you-can
Followed it step by step, and now have working custom shortcodes. Hope this helps anyone who might be trying to do likewise :)
Comment #20
memoday commented@snarf1974 Thanks a million for sharing this! I appreciate it.
I hope there will be an easier way to add custom shortcodes in the future.
Comment #21
denes.szabo commentedThanks Guys, I just added the link of Brianna Deleasa's tutorial to the project page into the Docs, tutorials section.
Comment #22
digibrill commentedCorrection to Brianna Deleasa's page: https://briannadeleasa.com/blog/shortcodes-drupal-yes-you-can
Comment #23
denes.szabo commented@digibrill THX! I just updated the module main page with the correct link to this blog post.
Comment #24
siraj j commentedI want to shortcode my content for the following html page, I installed the shortode contributed module with my drupal8 but I didn't get the page. Please help me
The broken investment value equation
NIIT Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laboris nisi ut aliquip ex ea commodo consequat. "
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. "
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Comment #25
denes.szabo commented@Siraj J: It's an old (very old) issue… 6.x, closed.
Please: create new issue, try to explain your problem clearly and easy repeatable manner. I see lot of "Lorem ipsum". This can't help.
What is the your input format config? Which ShortCode macros you enabled. What was the original content before the SC macro, what should be display?