I'm creating a short-code generator for the WordPress Add/Edit Post/Page screen.
I want to make sure that there does not exist more than one short-code in the same post/page. So I added an onclick function for the button so that whether there already exist a short-code, could be checked.
How do I go on doing this?
I searched around the TinyMCE API and the closest I got was the tinymce.Formatter.match method. But there's no example on this page. I don't really think that this has anything to do with the content search anyway.
Another way would be to simply use the getContent method and run javascript code against it. But I guess this wouldn't be the best option if there's something built-in for this already.
I do not know exactly what you mean by the term "short-code".
But i guess it is a string you can find using getContent-Method.
There are several other ways to search the editor content.
Since tinymce editor is rendered inside an iframe and is indeed real html code you can use all regular DOM-Methods of your browser. There are even some additional DOM-Methods provided in tiny_mce/classes/dom/DOMUtils.js.
Related
I have a plugin that utilizes shortcodes. I am using this plugin on my own site, but I'm also trying to provide documentation with usage samples on my site.
When placing the shortcode on my page, though, it's actually triggering and displaying the shortcode output instead of the code example of the shortcode itself.
For example, when I have this...
[paypal_ipn_list field1="txn_id" field2="payment_date" field3="first_name" field4="last_name" field5="mc_gross"]
The shortcode is actually triggered because I'm using the plugin myself. I need it to actually display that line, though, as a usage sample.
I tried replacing the actual []'s with ASCII values, so I used this...
[paypal_ipn_list field1="txn_id" field2="payment_date" field3="first_name" field4="last_name" field5="mc_gross"]
That actually displays that way, though, instead of converting to an actual [ or ] character. So that's not good for usage sample purposes, of course.
Is there some way I can disable or escape these shortcodes in this one place so I can output the usage sample, but still allow them to function everywhere else where I may actually be using them myself?
Any information on this would be greatly appreciated. Thanks!
You can escape shortcodes using a double bracket: [[shortcode_here]]
[[paypal_ipn_list field1="txn_id" field2="payment_date" field3="first_name" field4="last_name" field5="mc_gross"]]
I am setting up a blog. I have developed several views to sort out the various types of articles “business, design, news, etc.” On the article page and in the teaser however I would like to stye the “content: title” field. As seen in the example below.
In the research I have done it sounds as though you can accomplish this by creating a wrapper class in the “style settings” options in that titles configuration menu.
Here is where I am having difficulty. When I select “Customize field and label wrapper HTML” for instance nothing happens. I am not able to the field where I should be able to enter my custom wrapper class. I have tried hitting “apply” then going back, I have applying the section and then saving the changes to the view, and I have tried applying saving and flushing the cache but with no result.
Is there a configuration some where that is preventing me from applying this option? Or am I doing something wrong. It is frustrating to no end any advice would be much appreciated thanks.
To add a wrapper in views "content:title" this is the most easiest way -
Just go to Title fields rewrite section.
you can wrap an element using Style Settings of that specific field. just click a field and there you can see the options. wrap label / field in your desired element.
I have a list of pages that have to appear in different places of my Plone. If I use an internal link, I see an HTML link in the page but instead of that I would like to see the embedded content of the linked page.
I've tried to install some link plugins (Smart Link, vs.alias...) but I'm not able to find the solution.
I'm using Plone 4.3.
I don't know any Plone Plugin, which satisfy your requirement.
A long time ago i wrote this small js to show internal links in a popup using Plone's prepOverlay.
In this case you can put a popup custom CSS class on the internal link with TinyMCE.
It simply shows the content area of the given URL.
$(function(){
jq('a.popup').prepOverlay({
subtype:'ajax',
urlmatch:'$',urlreplace:' #content > *'
});
});
I guess this is a good starting point for your own implementation.
You could think of a criterion like location, contenttype, etc., to distinct, which articles should be picked (in worst case use collective.flag), then fetch them with a collection, to give you the links as a resultlist, and set its view to all_content, a nice feature, introduced in the Plone-4 series.
Maybe I am being a n00b here, but for the life of me, I cant find a simple drop in type solution for displaying an rss feed inside an aspx page?
I am looking for a simple solution, as when Firefox gets pointed to an rss feed, it just plainly displays it, no thrills, no fuss. I don't want to get into the xml and format it extensively. I just want a basic feed, will style it with font and a:styles. Thats it.
Any ideas?
EDIT:
I am attempting to show a worpress "feed" inside an aspx page...
The simplest solution is to just display it in an iframe, browser will take care of the formating. Otherwise you'll need to parse the xml and create appropriate html tags for each of its elements and/or attributes.
Is it possible to link to a page that doesn't necessarily exists as drupal content and not get a 404 page not found.
Example:
link: example.com/search/projects?content="words"
There is no search/projects node or page so obviously it returns page not found although I can still run my queries inside that page.
Views would probably be a solution here but I sort of need more control on the outputted html and don't feel like going in to the views templates.
I guess my question is if it is possible to mimic views feature of creating pages which will aggregate content but don't have content theme selfs.
Is this possible at all? It seems pretty standard right? I have no idea ho to do it thought...
You can create a menu item for search/projects and return anything you'd like.
http://api.drupal.org/api/drupal/developer%21hooks%21core.php/function/hook_menu/6
should get you started.