Jump to:

23001 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » <% require ... Not XML conform??

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1555 Views
  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    <% require ... Not XML conform?? Link to this post

    hey,
    my webserver does not show the website, when there are XML errors..

    for example an <input> Tag MUST end like this: <input .. .... >
    with this backslash.

    ---------------------------
    so, i want to use the "event_calendar" module.. in the .SS files there are codelines like:

    <% require css(event_calendar/css/calendar.css) %>

    and my website is not shown, This is displayed:

    XML-Verarbeitungsfehler: nicht wohlgeformt
    Adresse: http://mydomain.de/new-calendar/?stage=Live
    Zeile Nr. 94, Spalte 5:

    ...................<% require css(event_calendar/css/calendar.css) %>
    --------------------^

    when i make IF or CONTROL stuff with <% %> and there is an error with the syntax, maybe like <% if Photo%> (here is missing a space before the last %), then i get the same XML error what shows to the first %..

    so i think the <% require ... %> is maybe not correct or my silverstripe does not convert it?
    i am using 2.2.3, but in the "event_calendar" infopage there they say it works with 2.2.0 and higher. hummm?!?

    In the Calendar.ss there are there lines...
    <% require css(event_calendar/css/calendar.css) %>
    <% require javascript(event_calendar/javascript/calendar_core.js) %>

    and i deleted this line and added this lines to Calendar.php:

    Requirements::javascript("event_calendar/javascript/calendar_core.js");
    Requirements::css("event_calendar/css/calendar.css");

    after doing this the

    XML-Verarbeitungsfehler: nicht wohlgeformt
    Adresse: http://mydomain.de/new-calendar/?stage=Live
    Zeile Nr. 94, Spalte 5:

    ...................<% require css(event_calendar/css/calendar.css) %>
    --------------------^

    error is not shown, but another codeline from CalendarWidget.ss.
    so i think this works, BUT the CalendarWidget.ss hab no PHP file, so i cant change its lines into a PHP file like in Calendar.ss..

    can someone help me? ;)

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: <% require ... Not XML conform?? Link to this post

    Are you running SilverStripe 2.3? <% require %> was only recently added.

  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    Re: <% require ... Not XML conform?? Link to this post

    no i am using 2.2.3 in this project.

    http://doc.silverstripe.com/doku.php?id=modules:event_calendar

    says: "Requires a minimum of 2.2.0 version of Silverstripe."

  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    Re: <% require ... Not XML conform?? Link to this post

    now i deleted all the <% require... line from Calendar.ss and CalendarWidget.ss
    then i added all needed files into the Calendar.php

          Requirements::javascript("event_calendar/javascript/calendar_core.js");
          Requirements::css("event_calendar/css/calendar.css");
          Requirements::javascript("event_calendar/javascript/jquery-1.2.6.min.js");
          Requirements::javascript("event_calendar/javascript/jquery.date.js");
          Requirements::javascript("event_calendar/javascript/jquery.datePicker.js");
          Requirements::javascript("event_calendar/javascript/calendar_widget.js");
          Requirements::css("event_calendar/css/calendar_widget.css");

    now this site works and is shown. under TAB "annoucements" i can add some events, and the filter function and klicking throught the dates works.

    but when i want to create a "Calendar Event" page as an children in this calendar, i get this error email:

    Error: Object::__call() Method 'setAddTitle' not found in class 'ComplexTableField'
    At line 199 in /srv/www/vhosts/mydomain.de/httpdocs/sapphire/core/Object.php

    user_error(Object::__call() Method 'setAddTitle' not found in class 'ComplexTableField',256) line 199 of Object.php Object->__call(setAddTitle,Array) line of ComplexTableField->setAddTitle(a Date) line 219 of CalendarDateTime.php CalendarDateTime->getDateTimeTable(35) line 146 of CalendarEvent.php CalendarEvent->getCMSFields(CMSMain) line 363 of CMSMain.php CMSMain->getEditForm(35) line 752 of LeftAndMain.php LeftAndMain->EditForm() line 227 of LeftAndMain.php LeftAndMain->getitem(Array) line 261 of Controller.php Controller->run(Array) line 104 of Director.php Director::direct(admin/getitem) line 158 of main.php

    is this only in 2.3 too? can you help me to add this function maybe?

  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    Re: <% require ... Not XML conform?? Link to this post

    i added this into my ComplexTableField.php

    function setAddTitle($addTitle) {
          if(is_string($addTitle))
             $this->addTitle = $addTitle;
       }

    function Title() {
          return $this->addTitle ? $this->addTitle : parent::Title();
       }

    now the creation works, but there are some other error. i will look at them and try to eleminate them..
    when i realy cant do this i will ask here again ;)

  • banal
    Avatar
    Community Member
    901 Posts

    Re: <% require ... Not XML conform?? Link to this post

    Hi SalvaStripe

    I think you should post your issue in the Event Calendar thread: http://www.silverstripe.org/all-other-modules/show/252277?start=216

    I'm pretty sure the module is developed for/against 2.3.x... either me or the documentation is wrong

  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    Re: <% require ... Not XML conform?? Link to this post

    oha very big thread -.-

    i did updated my ss to 2.3.1 and now it all works realy perfekt
    humm.. its not that good that there is shown it works with ss2.2.0 and higher..

    its a realy nice module.. now i just try to add the filter and month widget to my sidebar. so, that the user will navigate to the calendar by clicking a date or the submit button. now
          $CalendarWidget
          $CalendarFilterForm
    are only shown in Calendar.ss, but maybe i will find a tweak i the very big Thread about this module ;=)

  • Artyom
    Avatar
    Community Member
    22 Posts

    Re: <% require ... Not XML conform?? Link to this post

    Moderator: Could you folks please update the "Template Syntax" section of

    http://doc.silverstripe.com/doku.php?id=templates

    to include <% require %> in all its permutations?

    I couldn't find any docs on it at all... and searching on a common word like "require" is an exercise in futility.

    thanks : - )
    -Artyom

    1555 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.