Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shortcode in sidebar
#1
Hello!

I would like to use shortcode for a excerpt plugin in the sidebar, but getsimple removes it. Looks like only html is allowed.

How can I override it?
Confused
Reply
#2
If I understand correctly, you already have a plugin that will throw you excerpts with the use of a shortcode, but the excerpt does not appear?

Second question, what exactly do you mean by "shortcode"? A php style shortcode consisting of <? ?> or some {mustage-like} tag?
Reply
#3
The shortcode looks lie this:

(% excerpt :portfolio, 340, html %)

It does not show up in the temple.

Is there an easy way to change this?
Reply
#4
As far as I know shortcodes/tags are only processed as long as they appear in the content field of the page. Eventually in other fields of the page as long as plugin supports it.

Shortcodes/tags won't work when placed in components or raw in template files.
Reply
#5
(2014-01-11, 07:50:00)Klas Wrote: (% excerpt :portfolio, 340, html %)

Are you using the Pages Excerpts plugin?
If so, it can be used with a function in the template or components. I think it would be like:

PHP Code:
<?php echo page_excerpt('portfolio'340'html'); ?>
Reply
#6
(2014-01-11, 19:51:42)Carlos Wrote:
(2014-01-11, 07:50:00)Klas Wrote: (% excerpt :portfolio, 340, html %)

Are you using the Pages Excerpts plugin?
If so, it can be used with a function in the template or components. I think it would be like:

PHP Code:
<?php echo page_excerpt('portfolio'340'html'); ?>
Thank you for your response, that will do it for the excerpts, but I have also an other problem, a mp3 plugin, who have the same syntax in its short-code. My bee that is not possible then, to use the short-code.
Reply
#7
Which plugin?
Reply
#8
Nevermind, I suppose it's the Mp3 Plugin Extended.

Try inserting something like this in your sidebar:
PHP Code:
<?php echo exec_filter('content','(% mp3:yourfile.mp3 %)'); ?>
Reply
#9
(2014-01-15, 02:22:37)Carlos Wrote: Nevermind, I suppose it's the Mp3 Plugin Extended.

Try inserting something like this in your sidebar:
PHP Code:
<?php echo exec_filter('content','(% mp3:yourfile.mp3 %)'); ?>

Thanks for your help, great!

The thing is that the file are going to bee change regularly (newest program), so I think it have to bee some hack on the default regulation for the sidebar, so the short-code will function.
Reply
#10
Ok, I got a solution for this.

Added this code to the template and added a site with the slug name latest.

PHP Code:
getPageContent('latest'); 

Thanks every one for your time and help!

The site so far
Reply
#11
If I need to stick small arbitrary php code in my site. I use my component hook plugin.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
(2014-01-17, 00:25:09)shawn_a Wrote: If I need to stick small arbitrary php code in my site. I use my component hook plugin.

Thanks, but I almost build my own template anyway, so I stick with my solution.
Reply




Users browsing this thread: 1 Guest(s)