Jump to content


Photo

Using Trumba with WordPress


  • Please log in to reply
9 replies to this topic

#1 iwork2ski

iwork2ski

    Member

  • Trumba Community Member
  • PipPip
  • 16 posts

Posted 13 November 2006 - 07:15 AM

I have tried the main calendar spud in a Wordpress blog. No Joy.
I surfed the forum and found out about ChenEditor for WordPress, installed that, still no joy.

This works....

<script type="text/javascript" src="http://www.trumba.com/k.aspx?calendar=ie_MY_CALENDAR"></script>

But this doesn't (copied from the Trumba Publish Control Panel)....

<script type="text/javascript" src="http://www.trumba.co...s.js"></script>
<script type="text/javascript">
$Trumba.addSpud({
webName: "ie_MY_CALENDAR",
spudType : "main" });
</script>

I want to use the spud so I can add the mix in spud and the spud option.

Any ideas what I should try next?

#2 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 13 November 2006 - 03:44 PM

Hi Bruce,
When you say that it doesn't work to use that second code example, does that mean the spud just doesn't display? When you go back to the source to edit the code, does the spud code look as it did when you pasted it, or has it been changed? It seems that on a few sites that I know use WordPress, they are using the "older" spud code, which is the version you pasted below that you said works.

Would you be able to send me a link to your page that doesn't work? You can send via PM if you prefer.

I might have to consult with our developers about this. So until I get more info, you can use that older version of the spud code that you said works. If you want to use the mix-in spud, here's the code you'd use, substituting the placeholder text with your calendar info.

<script type="text/javascript" src="http://www.trumba.com/k.aspx?calendar=ie_MY_CALENDAR&widget=mix"></script>.


You can use this code for any of the spuds, adding the &widget=spudname parameter after the calendar parameter. If you use any of the Promotion spuds that you place on pages that don't contain our main calendar spud, you also have to add the teaserbase variable before the spud code. Like this for the Upcoming events spud:

var trumba_teaserBase = "URL to your page that contains your main calendar spud";
<script type="text/javascript"
src="http://www.trumba.com/k.aspx?calendar=ie_MY_CALENDAR&widget=upcoming"></script>

I hope that works! Let me know if you have any questions about it.

Jill / Trumba UA

#3 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 17 November 2006 - 11:41 AM

Hi everyone,
Bruce sent me a link to his web page, and looking at the source code made it easy to see the reason the spuds in the new spud code aren't displaying. What is happening is that, at least in this case, WordPress is interpreting the spud code between the opening and closing script tags as regular text and converting it to HTML. So, for example, this spud code:

webName: "yourcalwebname"
spudType: "main"

might look like this if you open the page you created in WordPress in a browser and then view the source code:

webName: &#8220;yourcalwebname&#8221;,<br />
spudType : &#8220;main&#8221; });<br />

The HTML code conversion invalidates the spud code, so there is no spud in your page for the browser to display. This also can explain why you can get the older spud code to work. The older code includes the instructions for displaying the spud as an attribute inside of the opening script tag, so it's not being treated as normal text. The new spud code uses a different syntax, though, so it's always going to have text between the opening and closing script tags.

Disclaimer: This is what I concluded after seeing just one person's source code. If your page looks different or like the code isn't being converted, let me know and also send me a link to your page. Meanwhile, if anyone using WordPress can find a way to keep that code from being treated as normal text and converted to HTML, we'd love to know! I'll see is there's anything more I can find out, too.

Jill / Trumba UA

#4 iwork2ski

iwork2ski

    Member

  • Trumba Community Member
  • PipPip
  • 16 posts

Posted 19 November 2006 - 05:21 AM

I did a little digging and found this post in WordPress's site

I have clipped a the bit out. Since I am not a web programmer any ideas of how to adapt this?

Cheers,
Bruce



Javascript in Posts

To use Javascript inside of posts in WordPress, you need to take a few more steps. Odds are that this usage is for one or only a few instances, so adding the script to the header would be unnecessary.

For the occasional or one time use of Javascript, you need to put the script into a Javascript file and then call it out from within the post. Make sure that each script is defined by its function name such as:

function updatepage(){var m="Page updated "+document.lastMo.......}

To include a Javascript inside a post, you need to combine both the call to the script file with the call to the Javascript itself.

<script type="text/javascript" src="/scripts/updatepage.js"></script>
<script type="text/javascript">
<!--
updatepage();
//--></script>

If the src attribute of your javascript tag is being stripped out you need to turn off the rich editor (from the dashboard go to Users > Personal Options). If you are using the rich editor the javascript tag's src attribute may be stripped out even when manually editing in the HTML popup window.

#5 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 20 November 2006 - 10:53 AM

Hi Bruce,
Wow, thank you for posting this! I'll see if I can catch up with any of our developers for some help figuring out how to get our new spud code to work with WordPress.

Jill

#6 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 22 November 2006 - 10:57 AM

Hi Bruce,
I did some looking into this, too, and got my own WordPress blog, and I'm afraid I don't have very good news on this. The info you posted from the WordPress Codex is promising, but it turns out that it applies only if you've downloaded the WordPress software from wordpress.org and set it up on your own host. If you do that, you have much more control over the code behind the scenes.

If you have WordPress host your blog (which is what I did), javascript isn't supported. I checked out their forums, too, and answers to questions about javascript are repeatedly along the lines of, "it's not supported, period." This is for security reasons, to keep people from being able to hack into others' blogs or worse. They talk about it all on their site...

Anyway, I got some helpful info from one of their support people, explaining the difference between wordpress.org and wordpress.com in case you or anyone else is interested: FAQ about wordpress options

They do support javascript that comes from limited partners, and I asked if they would consider including us on that list and sent them samples of our spud code. So we'll see what happens. I'm sorry it's not good news, but I'm glad to know more about it now.

Jill / Trumba UA

#7 iwork2ski

iwork2ski

    Member

  • Trumba Community Member
  • PipPip
  • 16 posts

Posted 23 November 2006 - 01:54 AM

Jill,

Good news - I run wordpress off my own hosted site so I have control.

My programming skills aren't strong so it would take me a very long time to figure out how to make this work.

Could we use what they describe in their post? My struggle is I haven't spent much time programming in the last 15 years so it takes me a very long time to debug my work so that is why I was looking for some tips.

Cheers,
Bruce

#8 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 23 November 2006 - 11:30 AM

Oh, no, I'm sorry, Bruce. I made a grossly incorrect assumption about how you had this set up! Thanks for being so gracious about my error. :)

Alright, then, there can still be hope. If I am able to figure this out on my own over our holiday weekend, I'll gladly post more. If I need help from developers, it will take a little longer, and I'm sorry for the continued delay. If there are any javascript experts out there lurking and laughing at us, please feel free to jump in!

Jill

#9 Steve A

Steve A

    Advanced Member

  • Admin
  • PipPipPip
  • 349 posts
  • Gender:Male

Posted 03 December 2010 - 03:52 PM

The City of Seattle is a Trumba client and they just shared a tip on using Trumba with Word Press that I wanted to pass along.

The way they have gotten around WP’s non-support of Javascript is to create an include and/or HTMLl file that has just the code they require for the instance of the calendar (which can be as much as an entire “page” with tables, calendar spud, control spud, and then placed it on their own web server. On the template page they created in Word Press, they use iFrames to reference the file and pull it into WordPress by this means.


An example of how this looks can be found at: http://walkbikeride....e.gov/calendar/

Here is the iFrame code they used in the WP page template:

<iframe frameborder="0" style="width:750px;height:1200px" src="http://www4.seattle....e_calendar.htm" scrolling="auto"></iframe>

Thanks,
Steve

#10 Jill

Jill

    Moderator

  • Trumba Community Expert
  • PipPipPip
  • 1,243 posts
  • Location:Seattle, USA

Posted 02 January 2011 - 04:36 PM

Hey Steve!
Thanks for that info. It's been just over four years, but I *finally* actually did this! (In my previous post, I didn't specify which holiday, just said over a holiday, right?) ha ha. : ) So I thought I'd check up on the forums to see if there's anything new, and there it is! I love this walk/bike/ride program, btw, and very excited that they're using Trumba.

But surprisingly, it just worked for me to paste the main spud code right into a page. It also worked to put a promotion spud's code into the Text sidebar widget. Hmm, it just works, so I wonder if I did something wrong? (seriously, I started using WP only a few days ago, so I'm still suspicious.)

I'm on WP version 3.0.4, and to clarify, with an installation from .org and have full admin access to the files and server. I hope it keeps working because it looks awesome! I'll PM you the URL because the site's not done yet and not on a production server that I want hits on... And if anything changes, I'll post again.

Happy New Year!
Jill
ps: I was mostly jealous that your name appeared as last poster now, so I had to chime in, mwah ha ha ha. I'm glad my login still works. ; )




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users