Author Topic: Easy Spolier Plugin - Spoiler title  (Read 21950 times)

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Easy Spolier Plugin - Spoiler title
« on: September 06, 2011, 02:39:08 PM »
Hello!

I am using the Easy Spoiler Plugin with success EXCEPT for the spoiler title - I hope you can assist me with figuring out a solution!

Let me give you some background:

My theme supports and comes with shortcodes.
I am using one of these shortcodes for creating 4 columns inside my Easy Spolier Widget as this:
[one_fourth_first]ADDRESS information etc...[/one_fourth_first]
[one_fourth]ABOUT me and my work etc...[/one_fourth]
[one_fourth]CLIENTS of mine etc....[/one_fourth]
[one_fourth_last]CONTACT me info etc....[/one_fourth_last]

No problems here! The widget accepts these shortcodes and creates 4 perfect columns.

But now I must be able to have the shortcodes within the spolier title (in order for them to be aligned with the widget content)

But when adding the following to spoiler title, it only puts the text itself:
[one_fourth_first]ADDRESS[/one_fourth_first]
[one_fourth]ABOUT[/one_fourth]
[one_fourth]CLIENTS[/one_fourth]
[one_fourth_last]CONTACT[/one_fourth_last]

I went to the easy-spoiler.php file and noticed mentions of shortcode in the following:

add_shortcode('spoilergroup',array($wpEasySpoiler, 'process_group'));
add_shortcode('spoiler',array($wpEasySpoiler, 'process_shortcode'));

add_filter('comment_text', array($wpEasySpoiler, 'do_shortcode_in_comment'));
add_filter('widget_text', array($wpEasySpoiler, 'do_shortcode'));

Would it be possible to modify here to have the $spoilertitle accept shortcode?

I REALLY hope you can look into this problem and get back with a solution -- it would MAKE MY MONTH!!!

 :)
Johanna

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #1 on: September 06, 2011, 02:46:31 PM »
You want to embed a shortcode  within the title of the spoiler?


JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #2 on: September 06, 2011, 03:02:51 PM »
Yes! :-)

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #3 on: September 06, 2011, 04:38:42 PM »
Ok. I may accompany it with an admin GUI option to enable shortcode parsing in the title if it may break some things

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #4 on: September 06, 2011, 04:56:31 PM »
Sorry, I am not sure what your answer means.... what am I supposed to do to accomplish the shortcode in the title?

Are you working on accomplishing this right now? Will you get back to me about this?

Look forward to hearing from you!

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #5 on: September 06, 2011, 05:34:03 PM »
It'll be done by this evening. I was just saying you may need to click on a checkbox in the admin page of the spoiler to enable this extra parsing

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #6 on: September 06, 2011, 05:37:26 PM »
Wow! That is awesome!

Will you send a message here when it´s done?

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #7 on: September 06, 2011, 06:17:19 PM »
Sure

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #8 on: September 07, 2011, 01:20:56 AM »
Ok sorry took a while but its up in v1.6.   Should be making its way through the wordpress servers now.

It was more complicated than I thought as you cannot embed shortcode special chars within a shortcode itself at the wordpress level.  I.e. wordpress will bail if you do this:  title="[shortcode]" in its own shortcode parsing routines.

I got around it by requiring you to use a different character than the angular brackets.  The default is to use () rather than [] but you can choose  your own substitutes in the admin panel.

i.e: title="(myshortcode)whatever(/myshortcode)"

ES will replace the relevant characters and pump the string through shortcode processing.  ES is not particularly intelligent in its token replacement but I think it will do for the majority of cases.

Note that you WILL have to enable this new shortcode-in-title feature on the admin panel (a new checkbox).

good luck.  Please post back if you have issues.

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #9 on: September 07, 2011, 04:12:43 AM »
Hello,

Thank you very much for this!

I have successfully installed v. 1.6, I checked the shortcode-in-title feature on the admin panel.

I added the following shortcode for the title:
[spoiler title="(one_fourth_first)CCC(/one_fourth_first)
(one_fourth)CCC(/one_fourth)
(one_fourth)CCC(/one_fourth)
(one_fourth_last)CCC(/one_fourth_last)"]

The title shows up fine, but the alignment is off and I wonder if there is a maximum width set for the title? It breaks it off.

I have attached a screengrab.

Basically I want the title to be aligned with the content below.

So close to having it work - hope you can advise to clarify this last detail!

Thank you for the support. /J

« Last Edit: September 07, 2011, 04:16:12 AM by JK »

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #10 on: September 07, 2011, 11:10:43 AM »
Nah no fixed sizes. Post a link to the page and I'll look at the HTML and try to see what is going on

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #11 on: September 07, 2011, 03:11:55 PM »

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #12 on: September 07, 2011, 10:23:04 PM »
Hello! I sent you the link to the site.... did you get a chance to take a look at it?
Any idea on what might be causing this?

:)
J


doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spolier Plugin - Spoiler title
« Reply #13 on: September 08, 2011, 12:24:36 AM »
I was studying it and then it changed... are you in the middle of editing it?

I did find one problem with the inclusion of the ":" and whatnot.  I have attached a replacement .php file for the plugin.  If you install it and leave the results up until I can look at them I may be able to solve this

JK

  • Tadpole
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Easy Spolier Plugin - Spoiler title
« Reply #14 on: September 08, 2011, 12:37:26 AM »
Sorry! I was trying to check some other plugin compatibility and this probably caused the change.

I have now uploaded the new php file you sent and will not touch anything until you have taken a look at the site.

Look forward to your input!!

:)
J