Search

thanks a lot! i will try to get it running!

Forgot to mention:

<xsl:call-template name="keypeople-javascript" />

Where you want it to be output in the page.

I dont't wan't to troll-hijack this thread here, but instead of encouraging people to write bad code, shouldn't we be so clever to teach them how to do right and not how to do the wrong way right?

@gregor

dont

Instead writing inline javascript, why don't you attach the required data to span.link using the data attribute?

in your template you could do something like:

<span class="link" data-my-data="{your xpath expression}"/>

and in you javascript may do something like:

$(function () {
  $('parentElement').on('click', 'span.link', function (event) {
    event.preventDefault();
    var data = $(this).data('myData');
    // do stuff …
  });
});

@iwyg that would be my preferred solution (think i mentioned it) it keeps the code cleaner and no inline XSLT; though not sure on the content he's trying to put into the dom.

thanks to the great help of a person which was described to me as "a very wise geek", we got the problem solved and have it running. i documented here:

Github

still some problems. firstly, it can be that the code is not very beautiful, and i will happily welcome all hints on how to produce good code. (for the moment we are haopy that it is working)

one strange thing is still there: when we enter text in the data source, e.g. copy from text editor, it is very likely that some quotation mark, whitespace or so doesn't fit the systems expectations and therefore the whole code won't work anymore. no idea how this comes, but probably thereS a way to escape/purge/tidy the results before passing them?

thanks to the community for the support gregor

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