Help talk:Eventcalendar format

From semantic-mediawiki.org

Requesting help::Also having no results problems.

This request for help is the basically the same as the one below titled "Assistance Requested: Yellow "No results" Bar". I do not understand coding well but trying my best to pour over the documentation here. I have read through the comments for that person request and I do not understand what he/she may of done to fix there problem. There comments of success were. "GOT IT! It took a while, but I finally figured out that I needed to create new Property:Has_event_start and Property:Has_event_end pages.

Thanks for your patience!

Reply Parent More Dvicci (talk)"

If I take that persons data and paste it into our server. We get the same results. Still trying to understand how to get a calendar to appear with events. Any help would be great. Thank you.

Contents

Thread titleRepliesLast modified
Assistance Requested: Yellow "No results" Bar919:29, 21 December 2018
Ability to change date format display?212:57, 22 April 2017
Eventcalendar with Semantic Title421:26, 26 February 2017
Parameter values117:46, 27 October 2016
Does the jQuery eventcalendar plugin come already installed on Semantic Mediawiki/Mediawiki or do we have to install it separately?217:03, 17 March 2016
Size410:14, 24 December 2014
"No Results" Yellow errorbar218:13, 23 December 2014
Template Option for Event Calendar?400:58, 3 April 2014
How can I Change the default Color?112:17, 26 March 2014
EventCalendar Requirements000:04, 20 November 2013
Can icons be scaled?016:44, 12 September 2013
Template parameter003:49, 2 April 2013
Time displays only when there is an "end date/time"200:21, 27 November 2012
Description114:32, 5 November 2012
Internationalization520:24, 5 October 2012

Assistance Requested: Yellow "No results" Bar

I'm attempting to set up an eventcalendar on a personal wiki and have been spinning my wheels for a couple days. I'm a brand new mediawiki and Semantic / Semantic Result Formats user. Any and all help is very much appreciated.

I'm starting out very simple, and have created a page ("Calendar") with several event subobjects and an "ask:" with "format=eventcalendar". Instead of the expected calendar with events, I get a yellow bar with a blue triangle and the text "No results".

During my testing, and on the same page, I put another ask: with "

[[-Has subobject::{{FULLPAGENAME}}]]

", This does display all the event subobjects.

What have I done wrong that the eventcalendar ask: doesn't work, but the FULLPAGENAME ask: does? Any ideas, thoughts, or recriminations welcome.

Syntax below...

Versions from Special:Version:


  • MediaWiki: 1.31.1
  • PHP: 7.0.33-0+deb9u1 (apache2handler)
  • MariaDB: 10.1.37-MariaDB-0+deb9u1
  • Semantic MediaWiki: 3.0.0
  • Semantic Result Formats: 3.0.0

I don't think I'm missing anything, but maybe?

Here's the source of the "Calendar" page:


{{#subobject:
 |Has event = Thanksgiving Eve with Family
 |Has event start = 26 Nov 2018 06:00
 |Has event end = 26 Nov 2018 20:00
 |Has event description = Good times before Thanksgiving
}}
{{#subobject:
 |Has event = Thanksgiving with Family
 |Has event start = 27 Nov 2018 06:00
 |Has event end = 27 Nov 2018 20:00
 |Has event description = Good times at Thanksgiving
}}
{{#subobject:
 |Has event = Christmas Eve with Family
 |Has event start = 24 Dec 2018 06:00
 |Has event end = 24 Dec 2018 20:00
 |Has event description = Good times before Christmas
}}
{{#subobject:
 |Has event = Christmas with Family
 |Has event start = 25 Dec 2018 06:00
 |Has event end = 25 Dec 2018 20:00
 |Has event description = Good times at Christmas
}}
{{#subobject:
 |Has event = New Year's Eve with Family
 |Has event start = 31 Dec 2018 20:00
 |Has event end = 01 Jan 2019 00:00
 |Has event description = Good times on New Year's Eve
}}
{{#ask:[[Has event::+]][[Has event start::+]]
 |?Has event=title
 |?Has event start
 |?Has event end
 |?Has event description=description
 |format=eventcalendar
 |start=current
 |defaultview=month
 |limit=50
 |link=subject
 |legend=top
 |firstday=Monday
 |dayview=yes
 |headers=show
 |theme=vector
}}
{{#ask:[[-Has subobject::{{FULLPAGENAME}}]]
 |?Has event=title
 |?Has event start
 |?Has event end
 |?Has event description=description
}}

Page Results

Here's query and it's results (provided by "format=debug" in the eventcalendar "ask:"):


SELECT DISTINCT
  t0.smw_id AS id,
  t0.smw_title AS t,
  t0.smw_namespace AS ns,
  t0.smw_iw AS iw,
  t0.smw_subobject AS so,
  t0.smw_sortkey AS sortkey, t0.smw_sort 
FROM
  `wiki_smw_object_ids` AS t0 
INNER JOIN
  (`wiki_smw_di_wikipage` AS t2  
INNER JOIN
  `wiki_smw_di_wikipage` AS t5 ON t2.s_id=t5.s_id) ON t0.smw_id=t2.s_id 
WHERE
  (t2.p_id='575' 
   AND (t5.p_id='579')
  ) 
  AND t0.smw_iw!=':smw' 
  AND t0.smw_iw!=':smw-delete' 
  AND t0.smw_iw!=':smw-redi' 
ORDER BY
  t0.smw_sort ASC    
LIMIT
  505 
OFFSET
  0
 
+-----+-----------+----+----+-----------------------------------+--------------------------------------------+--------------------------------------------+
| id  | t         | ns | iw | so                                | sortkey                                    | smw_sort                                   |
+-----+-----------+----+----+-----------------------------------+--------------------------------------------+--------------------------------------------+
| 743 | Calendar  |  0 |    | _321fe513e5f3995e02eda27a1997a16d | Calendar# 321fe513e5f3995e02eda27a1997a16d | Calendar# 321fe513e5f3995e02eda27a1997a16d |
| 744 | Calendar  |  0 |    | _4f2367d5bb752e4ead158b9fddc24962 | Calendar# 4f2367d5bb752e4ead158b9fddc24962 | Calendar# 4f2367d5bb752e4ead158b9fddc24962 |
| 745 | Calendar  |  0 |    | _bcbb94b2d13ce4fe5eb9d34ed8a19feb | Calendar# bcbb94b2d13ce4fe5eb9d34ed8a19feb | Calendar# bcbb94b2d13ce4fe5eb9d34ed8a19feb |
| 741 | Calendar  |  0 |    | _bfe0e2d5aa3b97d409c1872b2dc84076 | Calendar# bfe0e2d5aa3b97d409c1872b2dc84076 | Calendar# bfe0e2d5aa3b97d409c1872b2dc84076 |
| 742 | Calendar  |  0 |    | _f628fd6b030235d58c51d11b282938c7 | Calendar# f628fd6b030235d58c51d11b282938c7 | Calendar# f628fd6b030235d58c51d11b282938c7 |
+-----+-----------+----+----+-----------------------------------+--------------------------------------------+--------------------------------------------+

22:15, 19 December 2018

According to the image posted it looks like you did not assign any datatype to the respective properties most importantly to "Has event start" and "Has event end". You can also use the sandbox to do live testing.

11:14, 20 December 2018

Thanks for the quick reply! I've seen that mentioned elsewhere and for the life of me cannot find how to explicitly define data types. I've spent a few days googling for it and came up dry. I'll look into the sandbox, but if you would please elaborate a little and show me what I'm missing in my subobject defintions, I would greatly appreciate it.

16:15, 20 December 2018

I added the link to the help page on setting datatypes to properties to the datatype page for better results. Thanks for noting that it was obviously not the easiest page to find.

19:30, 20 December 2018
 

I created a test page out on sandbox.semantic-mediawiki.org and using the exact same definitions, it never gets past the three loading dots there. I stripped down the eventcalendar call to the bare minimum, and it still stays at the three loading dots. What I've read leads me to believe that this is a server-side issue. It may be a server side issue on my site as well, but I'm not certain how to debug it yet, if so.

2018-12-20 09 45 50-DvicciCalendarTest - Semantic MediaWiki - Sandbox.png

Thanks again!

17:53, 20 December 2018

The test on sandbox failed because of the experimental Content Security Policy setting. It is now working as expected after removing the policy setting.

19:29, 20 December 2018

Yup. That did the trick, and the code that does not work on my own server works just fine in the Sandbox - even without explicitly defining any date datatypes (maybe that's done behind the scenes somewhere?). Thanks for pointing out the sandbox for me, that at least gives me a place to start! I'll pour through the versions and requirements. In the end, it may simply be a matter of ripping and reinstalling SMW and SRF.

I'm still struggling a little with the syntax to define a date datatype, but I'll play around with it in the sandbox until I figure that out.

Thanks again!

19:56, 20 December 2018

On sandbox the respective properties were already set by another person. So editing the property page as described in the link I provided did not work for you?

23:23, 20 December 2018
 
 
 
 
 

Ability to change date format display?

Is there a parameter to the Eventcalendar format to change the date display format in Week and Day displays.

For example, right now the date format is DAY/MONTH (e.g. Tue 18/4). That style of date formatting might confuse some of our users because we're in the U.S.

Thanks for the great work on SMW.

Cheers - Andrew Rechenberg (talk) 15:38, 18 April 2017 (CEST)

15:38, 18 April 2017

This is defined here so if I am not mistaken the system messages "MediaWiki:Srf-ui-eventcalendar-format-column-week" and "MediaWiki:Srf-ui-eventcalendar-format-column-month-day" can be used to manipulate the display.

16:17, 18 April 2017

> This is defined here so if I am not mistaken the system messages "MediaWiki:Srf-ui-eventcalendar-format-column-week" and "MediaWiki:Srf-ui-eventcalendar-format-column-month-day" can be used to manipulate the display.

To extend on the mentioned system message, if you use [0] and switch the user language then you can see changes such as for DE it shows Mi 16.6. while for JA it is displayed as 6月16日.

[0] https://sandbox.semantic-mediawiki.org/wiki/Recurring_events

12:57, 22 April 2017
 
 

Eventcalendar with Semantic Title

Any idea how I can use Eventcalendar with Semantic Title? When I use Semantic Title, the Page Name is displayed in the calendar (A000000) instead of the Semantic, descriptive title. Can I overrule this?

12:42, 25 February 2017

The event calendar does work out of the box with the Help:Display title. I'm not sure about Semantic Title but I would interpret [0] as that the extension has lost its usefulness.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1410#issuecomment-244064848

13:03, 25 February 2017

Ah, okay, thank you! I will look into that.

13:20, 25 February 2017
 

What I do is to set an extra property to the events called e.g. "Is event title" and query this into the calendar with |?Is event title=title. See also the demo. Works great and no need for displaytitle and related stuff.

14:19, 25 February 2017

I already had a separate property, your hint for using "title" with this was the key! Genius!

21:26, 26 February 2017
 
 

Parameter values

I'd like to see possible values for parameters within the table. It took me a while to figure out how to hide headers, is it "none", is it "hide"? (It's the latter.) Maybe that's more difficult for non-natives or non-devs, but possible parameter values should be exclusive, hence easy to name. I would have expanded the table myself (and included the format specific values within the table in a certain column), but #smdoc is new to me, couldn't find where to edit the table. :( While I'm at it, I'm also missing a simple complete usage example (embed code).

15:21, 27 October 2016

#smwdoc cannot handle this right now. I only shows the default values. I think there is a feature request for this somewhere.

17:46, 27 October 2016
 

Does the jQuery eventcalendar plugin come already installed on Semantic Mediawiki/Mediawiki or do we have to install it separately?

The first sentence of the Help page is unclear:

  • The result format eventcalendar the jquery.fullcalendar plugin to generate an event calendar with different views ('month', 'basicweek', 'basicday', 'agendaweek', 'agendaday' ) to choose from.

Just as the subject line says, does the jQuery eventcalendar plugin come already installed on Semantic Mediawiki/Mediawiki or do we have to install it separately?

21:23, 11 March 2016

I just amended the sentence a bit. No, the jQuery eventcalendar plugin is shipped bundled with the software. What you need to install though is the Extension "Semantic Result Formats" extension, since this result format is not part of Semantic MediaWiki core.

22:48, 11 March 2016

Thanks for the reply!

17:03, 17 March 2016
 
 

Is there a way to make this calender less huge?

03:57, 2 April 2013

I succeeded in making this calendar less high by putting this in my MediaWiki:Common.css :

/* Event calendar help class */ 
.smw-eventcalendar {
  width:100%;
  height:200px;
}

then I added this to the ask request :

{{#ask:
...
|class=smw-eventcalendar
...
}}

(this is "hinted" in the Help page)

23:01, 27 July 2013

That did not work for me. The calendar stays the same size, though the content below thinks its only 200px and thus ends up on top of the calendar.

05:01, 6 August 2013

right, I was with smw 1.8 and it was working (as long as the content of the calendar was not too high)

now with smw 2.0 I ve got the same issue that you have : the calendar stays the same height, though the content below thinks its only 200px and thus ends up on top of the calendar.

23:34, 8 October 2014
 
 
 

"No Results" Yellow errorbar

I've been trying to get a calendar up and running on http://testwiki.gotannetworks.com/wiki2/ But for the life of me I can't get it to work. It keeps giving me the 'No Results' error. I followed (I think) the instructions and examples pretty well.

It's probably something stupid and minor, yet I can't find it =\

Could anybody help me? login = Tempuser password = powerrangers

11:06, 23 December 2014

One important factor is to have appropriate datatypes declared for each property otherwise functionality is limited or not guaranteed (see [0]). Please carefully examine what has been done on this wiki and compare it to your wiki environment.

[0] http://testwiki.gotannetworks.com/wiki2/index.php?title=Property:Has_event_start

13:30, 23 December 2014

Thank you very much, I already thought it was something I did wrong or forgot :). I think I've got the hang of it. However, when I look at the Demo eventcalendar and I hover over an event it only shows the description in the mouse-over. I can't seem to get this same information correctly displayed in mine.

When I create Property:Has_event with datatype text (or string) the event completely disappears from the calendar.

Any thoughts?

17:58, 23 December 2014
 
 

Template Option for Event Calendar?

I have an 'Event:' namespace and would like to strip the prefix before displaying the article links on the calendar. I see format=Calendar can do this by specifying a template. Is there a way to accomplish the same with Eventcalendar? (or in the query itself?)

I've just started mucking about with the calendar formats. Seriously amazing stuff. Blew my mind. - Lbillett (talk) 17:32, 9 March 2014 (CET)

18:32, 9 March 2014

Sorry, rookie mistake. Looks like I can do this by specifying |?Title=title (all my Event: namespace pages have a Title property). While this very much gives the desired output, I'd still like to modify the display color depending on the condition of another property (Property:Complete). This can be done with the calendar format and a template, but not sure if it's possible here. Maybe with a compound query, but that's probably a ways off.

18:14, 13 March 2014

Well, I'm posting in the wrong place (I should be at the extension talk page, not the help page).

Now that I think I understand the docs, just about everything I wanted to do is totally possible. Setting the color can be accomplished by setting the event article with a text type property that contains a color, and specifying that with |?Pages color property=color in the call. Pretty cool. It's not perfect because the color is also dependent on the current date (which is why a template option would help). I'll have to find a way to refresh a certain set of pages via routine with SMW_refreshdata.

Weird that there's talk about the eventcalendar format using subobjects... I don't seem to see how they're needed in the semanticInternalObjects sense.

00:54, 16 March 2014

> I don't seem to see how they're needed in the semanticInternalObjects sense.

Not sure what you mean by the above statement but using a subobject allows for each event the be represented as an individual entity within the same page source which enables to separate source from data.

SemanticInternalObjects has nothing to do with the EventCalendar.

> Template Option for Event Calendar?

It is not supported but of course if you want to add such feature the community would welcome such effort.

12:25, 26 March 2014

Ahhhh. I get it. I didn't realize the difference between using #subobject (now in the SMW core) and the internal objects extension. I thought they were totally different (well, I guess the used to be). Also didn't understand it was referring to multiple events set on the same page... I should have gotten that from the example.

Will see how good I get at this php business. I'm still awestruck with how you guys managed to work in the objects stuff without (from what I've seen) doing anything crazy to the content stored in articles, but having it all query just the same. Clever!

00:58, 3 April 2014
 
 
 
 

How can I Change the default Color?

I want to set a different color for all events, when you create a Eventcalendar the default color is kind of blue, How can I change this color? I tried putting "| color=red" on the query but it doesn't work...

05:20, 26 March 2014

A query doesn't change the composition of an entity (an event), properties describe an entity therefore you should use a property to describe the color. See [0] on how a template sets default colors depending on its context.

Please also have a look at the Demo:Event calendar page which demonstrates how a query uses printout statements to generate events with different colors.

For some technical details about the colors, see [1].

[0] http://semantic-mediawiki.org/w/index.php?title=Template:Event_calendar_item&action=edit

[1] http://arshaw.com/fullcalendar/docs/event_rendering/Colors/

12:17, 26 March 2014
 

EventCalendar Requirements

I am running the current version of Mediawiki along with SMW and the SMW Bundle on IIS7.

Do I need anything additional to make this extension work?

When I create a form and link it to a button, when the button is clicked, I get taken to the front page.

Are there any step by step instructions for building a calendar?

Thanks,

Wade

00:04, 20 November 2013

Can icons be scaled?

I would expect sth like:

... | ?has file=icon#12px ...

or

... | has file=icon | iconsize=12px ...

or can I pass the size from the queried page somehow...

or is the only way to upload the icon that size i want eventcalender to use...

16:44, 12 September 2013

Template parameter

Request from SMWCon Spring 2013: add template parameter support

03:49, 2 April 2013

Time displays only when there is an "end date/time"

The "Start date/time" column/statement is mandatory while the "End date/time" is optional. Still the date/time is displayed only whene both a "Start date/time" and an "End date/time" is given. When only the "Start date/time" is given there is no date/time displayed. Example: http://www.wikiteater.se/index.php/F%C3%B6rest%C3%A4llningar

Is this the correct behaviour?

11:15, 3 November 2012
14:41, 5 November 2012

SRF_EventCalendar.php is perfectly correct. This is an issue with fullcalendar.

The reason for this behavior was because of fullcalendar.min.js (line 4652 in fullcalendar.js):

    if (!event.allDay && seg.isStart) {
        html += ...

This is the js-code for displaying the time in month view. Events without end-time are set to allDay-events. This code only shows the time if it is not an event.allDay. To show the time if there is a start date we can change this to:

    if (event.start && seg.isStart) {
        html += ...

Best regards Martin

00:18, 27 November 2012
 
 

Description

Could it be possible to make a custom "description tooltip" to show information from multiple printout statements, as well as pictures (for instance using a template)?

10:20, 3 November 2012

Doing something like ...|?Description 1|?Description 2| ... will result in a compound concatenated string that is displayed for each event. Make sure you are using the latest git repo because I saw http://www.wikiteater.se/ still uses the old tooltip. The new tooltip is capable of displaying images but the event calendar tooltip does not make use this capability but you are free to implement such feature. For an example on what needs to be done see [1] to add the appropriate image content to the tooltip ... content:

tooltip.show( {
	context: element,
	content: event.description.substring( 0 ... ,
	title: mw.msg( 'smw-ui-tooltip-title-event' ),
	button: false
} );

[1] http://craigsworks.com/projects/qtip/demos/content/images

14:32, 5 November 2012
 

Internationalization

Thanks for a beautiful calendar. How do we get this extension into other languages, are there locales, or is it possible to translate? Any advice would be appreciated.

18:29, 28 September 2012

Thanks and well I'd love to see other people getting involved.

As for the internationalization this is rather a fullcalendar.js issues than a SRF printer issue because the resource definition can get access to translations that are transferred from MW (see [1]). Maybe [2],[3] can shed some light on what needs to be done in order to get a more internationalized calendar version.

Something like below should be feasible (I haven't checked nor tested it)

buttonText: {
            today: mw.msg( 'srf-eventcalendar-button-today' ),
        },

Hope this helps ...

[1] https://www.mediawiki.org/wiki/Localisation#Using_messages_in_JavaScript

[2] http://code.google.com/p/fullcalendar/issues/detail?id=47

[3] http://stackoverflow.com/questions/8106646/jquery-fullcalendar-full-translation

23:08, 28 September 2012

We need to create and maintain message-identifiers in fullcalendar.js. We need to create an i18n.php-file containting those messages. We need to make them work together using the ResourceLoader.

I know php and js but not how to practically contribute code and i18n-text to the project. You can contact me by e-mail if you want.

Martin

16:05, 4 October 2012

You don't have to create an extra file, you only have to register all message keys with SRF_Messages.php and publish those keys with SRF_Resources.php as well (see example 'messages' => array( ...)) to ensure the resource file is able to access those messages. (If you register message keys with SRF_Resources.php than the ResourceLoader integration will taken care of.)

The only thing that is left is to adjust the ext.srf.eventcalendar.js file with those message keys (using mw.msg( 'srf-eventcalendar-label-...' )) so the fullcalendar object can access those translated messages. (see links above for proposed methods on how this can be achieved in a fullcalendar instance ).

If you need advise on how to add translations to SMW/SRF messages files (SRF_Messages.php), you can contact Kghbln on this matter.

Please be remind that all what is provided here is community work and since my timetable will not allow me to drill into this further, I hope the above description is enough to give you a heads up otherwise you might consult [1], [2] as well.

[1] http://www.mediawiki.org/wiki/ResourceLoader/Features

[2] https://www.mediawiki.org/wiki/Localisation#Using_messages_in_JavaScript

16:43, 4 October 2012

Well, since I figured that might take a bit for you to get it work. I added i18n support with [1]. Which means as soon as the keys are available in translatewiki, you can start to translate

	'srf-ui-eventcalendar-label-today' => 'Today',
	'srf-ui-eventcalendar-label-month' => 'Month',
	'srf-ui-eventcalendar-label-week' => 'Week',
	'srf-ui-eventcalendar-label-day' => 'Day',
	'srf-ui-eventcalendar-label-allday' => 'All day',
	'srf-ui-eventcalendar-format-time' => 'h(:mm)t',
	'srf-ui-eventcalendar-format-time-agenda' => 'H:mm( - H:mm)',
	'srf-ui-eventcalendar-format-axis' => 'H:mm',
	'srf-ui-eventcalendar-format-title-month' => 'MMMM yyyy',
	'srf-ui-eventcalendar-format-title-week' => 'd [ yyyy]{ \'—\'[ MMM] d MMM yyyy}',
	'srf-ui-eventcalendar-format-title-day' => 'dddd, d MMM, yyyy',
	'srf-ui-eventcalendar-format-column-month' => 'ddd',
	'srf-ui-eventcalendar-format-column-week' => 'ddd d/M',
	'srf-ui-eventcalendar-format-column-day' => 'dddd d/M',

Month, days are taken from MW's own message key's, so no need for any translation.

[1] https://gerrit.wikimedia.org/r/#/c/26735/

16:28, 5 October 2012

Perfect!

Thought it would be good to have the other texts translated as well so just did 100% of SMW and SRF (except for om SMW-message that does not show it's pop-up window).

20:24, 5 October 2012