Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

<% require ... Not XML conform??


Reply


8 Posts   1653 Views

Avatar
SalvaStripe

Community Member, 89 Posts

15 April 2009 at 9:34pm

Edited: 15/04/2009 9:37pm

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? ;)

Avatar
Willr

Forum Moderator, 5513 Posts

15 April 2009 at 9:57pm

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

Avatar
SalvaStripe

Community Member, 89 Posts

15 April 2009 at 10:04pm

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."

Avatar
SalvaStripe

Community Member, 89 Posts

15 April 2009 at 10:10pm

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?

Avatar
SalvaStripe

Community Member, 89 Posts

15 April 2009 at 10:18pm

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 ;)

Avatar
banal

Community Member, 901 Posts

16 April 2009 at 2:56am

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 :)

Avatar
SalvaStripe

Community Member, 89 Posts

16 April 2009 at 3:16am

oha very big thread -.- :D

i did updated my ss to 2.3.1 and now it all works realy perfekt :D
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 ;=)

Avatar
Artyom

Community Member, 22 Posts

25 April 2009 at 4:27pm

Edited: 25/04/2009 4:28pm

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