Search

Hello,

I finally decided to stay at home all weekend and finish my website. I must admit symphony really kicked my ass big times, I really love the concept of being able to really make your own content the way you want, the way you think. The XSLT part has been quite hard to understand and I must admit I still have sometimes troubles with it, perhaps someday I’ll eventually become a ninja (in waiting, I lurked hard around here and get some chunks of utilities here and there - thank you guys for 1/ pagination 2/ html truncation 3/ auto headline levels)

So, here are a few question I have now that it’s working:

1/ Is there (or will there be) an other way to post comments or any kind of other things on a website without having the form redirecting to the same page? I have several people who experienced a lil issue when posting, pressing f5 and posting twice ( go middle of the page, “oneliner”…) Am I missing something?

2/ In a near future, i’d like to work on some articles that would be involving some videos. I know there is a vimeo field but actually, I would prefer to be able to post a video right between two paragraphes :/ My question is: would it be possible? Can I add “new rules” to markdown, like, for instance [vimeo_id][vimeo] or replace markdown with html formatters like fck or tinymce.

my website: http://mynameiskaneel.com

ps: oh and props for the fact you can move the website from one directory to another without any troubles and only updating the .htaccess, smart!

Is there (or will there be) an other way to post comments or any kind of other things on a website without having the form redirecting to the same page?

There is indeed. Have you tried using Events yet? You can send a hidden field with a name of redirect in your form POST, and the user will be redirected to that URL if the event entry is created successfully.

My question is: would it be possible? Can I add “new rules” to markdown, like, for instance [vimeo_id][vimeo] or replace markdown with html formatters like fck or tinymce

You can do this using XSLT. Here’s an idea for embedding YouTube. Put simply, just create a new paragraph and paste the YouTube URL, and using XSLT you can look for single paragraphs that begin http://www.youtube..., and replace the paragraph with the embedded video. The same code can be modified for Vimeo, or almost any other provider. No extra Vimeo Video Field required :-)

Loving your site design! Be sure to add it to the Showcase!

Hello Nick, thank you for your fast answer (and actually, thank you for all the nice tips you’re giving on symphony, you helpt me a bunch of time).

There is indeed. Have you tried using Events yet? You can send a hidden field with a name of redirect in your form POST, and the user will be redirected to that URL if the event entry is created successfully.

So basically, I would only need to put a redirect hidden input that redirect to the very same page and this way, the user would lose the POST datas. I should have thought about it!

Thank you for the second tip, I’ll check this asap (which mean, when my workday will be over :/)

Oh and an other question (I might have new questions almost every days). I have this veryvery bad habit of validating my xhtml and I noticed an issue that didn’t happen on my localhost when I was validating. It seems my “oneliner” form is generating a hidden input. Yeah, how weird is that?

Something like:

<input type="hidden" name="PHPSESSID" value="an_id_here"/>

Unfortunatly, this input is generated out of a fieldset, which lead to an invalid xhtml 1.0 Strict document… I wouldn’t mind if there were like 10 mistakes but this is the only one. I wouldn’t even mention collegues pulling my legs about it ahah.

Maybe it comes from my hosting, I actually have no idea, should I post this as a troubleshooting?

I have this veryvery bad habit of validating my xhtml

There’s nothing bad about that ;-)

Maybe it comes from my hosting, I actually have no idea, should I post this as a troubleshooting?

Never seen this before. You’re saying this is being injected into your HTML on a Symphony site? It could be a legacy PHP, maybe. I’m not qualified enough to diagnose I’m afraid.

<input type="hidden" name="PHPSESSID" value="an_id_here"/>

Seems to be PHP’s transparent SID feature. Can (and should) be disabled using ini_set().

Hmmm, I remember the transparent SID issue back years ago. I thought that was only showing randomly in the GET params though :/

Crap. Ive been googling and it seems it’s something that happened to some persons who are registered on my host.

Seems to be related to ini-set() and “url_rewriter.tags” param indeed. Weird it’s active while I’m on PHP 5

Ok so, my provider let us directly change some apache params from the htaccess, I managed to switched off the session trans_id that way. Thank you phoque for the tip :)

An update to my website. I decided to add the soundcloud player right on each release that actually has a soundcloud field filled and here is my addition to the typography.xsl file.

Thanks to the user “robphilp”

<xsl:template match="*[starts-with(., 'http://soundcloud.com/kaneel/')]" mode="html">
    <xsl:choose>
        <xsl:when test="text()[starts-with(., 'http://soundcloud.com/kaneel/sets/')]">
            <xsl:element name="object">
                <xsl:attribute name="width">100%</xsl:attribute>
                <xsl:attribute name="height">200</xsl:attribute>
                <xsl:element name="param">
                    <xsl:attribute name="name">movie</xsl:attribute>
                    <xsl:attribute name="value">
                        http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fkaneel%2F<xsl:value-of select="normalize-space(substring-after(., 'http://soundcloud.com/kaneel/'))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=ff7700
                    </xsl:attribute>
                </xsl:element>
                <xsl:element name="param">
                    <xsl:attribute name="name">allowscriptaccess</xsl:attribute>
                    <xsl:attribute name="value">always</xsl:attribute>
                </xsl:element>
                <xsl:element name="param">
                    <xsl:attribute name="name">wmode</xsl:attribute>
                    <xsl:attribute name="value">window</xsl:attribute>
                </xsl:element>
                <xsl:element name="embed">
                    <xsl:attribute name="wmode">window</xsl:attribute>
                    <xsl:attribute name="allowscriptaccess">always</xsl:attribute>
                    <xsl:attribute name="height">200</xsl:attribute>
                    <xsl:attribute name="width">100%</xsl:attribute>
                    <xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
                    <xsl:attribute name="src">
                        http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fkaneel%2F<xsl:value-of select="normalize-space(substring-after(., 'http://soundcloud.com/kaneel/'))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=ff7700
                    </xsl:attribute>
                </xsl:element>
            </xsl:element>
        </xsl:when>
        <xsl:otherwise>
            <xsl:element name="object">
                <xsl:attribute name="width">100%</xsl:attribute>
                <xsl:attribute name="height">81</xsl:attribute>
                <xsl:element name="param"><xsl:attribute name="name">movie</xsl:attribute>
                    <xsl:attribute name="value">
                        http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fkaneel%2Fets%2F<xsl:value-of select="normalize-space(substring-after(., 'http://soundcloud.com/kaneel/sets/'))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=ff7700
                    </xsl:attribute>
                </xsl:element>
                <xsl:element name="param">
                    <xsl:attribute name="name">wmode</xsl:attribute>
                    <xsl:attribute name="value">window</xsl:attribute>
                </xsl:element>
                <xsl:element name="embed">
                    <xsl:attribute name="wmode">window</xsl:attribute>
                    <xsl:attribute name="allowscriptaccess">always</xsl:attribute>
                    <xsl:attribute name="height">81</xsl:attribute>
                    <xsl:attribute name="width">100%</xsl:attribute>
                    <xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
                    <xsl:attribute name="src">
                        http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fkaneel%2F<xsl:value-of select="normalize-space(substring-after(., 'http://soundcloud.com/kaneel/'))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=ff7700
                    </xsl:attribute>
                </xsl:element>
            </xsl:element>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

It does the difference between sets and singles. If anybody want to reuse this, just replace “kaneel” with your soundcloud user id!

Example here

Very nice! Thanks for posting that!

Making more sense I believe!

<xsl:template match="*[starts-with(., 'http://soundcloud.com/')]" mode="html">
    <xsl:variable name="sc-user" select="substring-before(substring-after(text(), 'http://soundcloud.com/'),'/')" />
    <xsl:choose>
        <xsl:when test="contains(text(),'/sets/')">
            <xsl:call-template name="soundcloudplayer">
                <xsl:with-param name="width">100%</xsl:with-param>
                <xsl:with-param name="height">200</xsl:with-param>
                <xsl:with-param name="value-url">
                    http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F<xsl:value-of select="$sc-user"/>%2F<xsl:value-of select="normalize-space(substring-after(., concat('http://soundcloud.com/',$sc-user,'/')))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=becfe8
                </xsl:with-param>
            </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
            <xsl:call-template name="soundcloudplayer">
                <xsl:with-param name="width">100%</xsl:with-param>
                <xsl:with-param name="height">81</xsl:with-param>
                <xsl:with-param name="value-url">
                    http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F<xsl:value-of select="$sc-user"/>%2F<xsl:value-of select="normalize-space(substring-after(., concat('http://soundcloud.com/',$sc-user,'/')))"/>&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=false&amp;show_artwork=true&amp;color=becfe8
                </xsl:with-param>
            </xsl:call-template>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="soundcloudplayer">
    <xsl:param name="width"/>
    <xsl:param name="height"/>
    <xsl:param name="value-url"/>
    <xsl:element name="object">
        <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
        <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
        <xsl:element name="param">
            <xsl:attribute name="name">movie</xsl:attribute>
            <xsl:attribute name="value">
                    <xsl:value-of select="$value-url"/>
            </xsl:attribute>
        </xsl:element>
        <xsl:element name="param">
            <xsl:attribute name="name">allowscriptaccess</xsl:attribute>
            <xsl:attribute name="value">always</xsl:attribute>
        </xsl:element>
        <xsl:element name="param">
            <xsl:attribute name="name">wmode</xsl:attribute>
            <xsl:attribute name="value">window</xsl:attribute>
        </xsl:element>
        <xsl:element name="embed">
            <xsl:attribute name="wmode">window</xsl:attribute>
            <xsl:attribute name="allowscriptaccess">always</xsl:attribute>
            <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
            <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
            <xsl:attribute name="type">application/x-shockwave-flash</xsl:attribute>
            <xsl:attribute name="src">
                <xsl:value-of select="$value-url"/>
            </xsl:attribute>
        </xsl:element>
    </xsl:element>

</xsl:template>

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details