lpa
Members-
Posts
212 -
Joined
-
Last visited
Everything posted by lpa
-
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
Thanks Soma! I will use your example for pagination. I am not very good finding things on this forum... A new question regarding repeaters and selectors: Trying to use the find above with some fields from the actual page containing the repeater or even the parent of the page containing the repeater. $items = $pages->find("template=repeater_eventdetails, date>0, sort=date, include=all, parent=somepagename"); Is this possible or what would be the correct syntax to find the pages containing these repeaters, that have parent "somepagename"? Or is there selector like: has_parent=somepagename or getForPage=somepagename? -
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
I would really like to know if there is an easy way to enable the pagination in my code above? Or what would you suggest? -
Hi, I just translated the two english language files in /wire/modules/Inputfield/InputfieldTinyMCE/tinymce-3.5.8/plugins/codemagic/langs/ and changed the names to fi_dlg.js and fi.js. Those files are attached here renamed with .txt. I think it was like when using the language code fi codemagic supposed to find files called fi.js and fi_dlg.js. fi_dlg.js.txt fi.js.txt
-
Hi Teppo, I can click on "Compare with current" but I don't see any diff. I get this on JS console: Uncaught TypeError: Cannot read property 'value' of null I am on Mac OS X with both Safari and Chrome.
-
I am trying to use Zurb Foundation Reveal modal dialog to show the map with some other information. I have the problem that the map is not loaded correctly, only showing part of the map in the upper left corner with gray background on the leftover part of the map. Could it be related to this problem discussed here and how could I fix this?
-
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
I tried to use the following to get the pagination $events = new PageArray(); $items = $pages->find("template=repeater_eventdetails, date>0, sort=date, include=all"); foreach($items as $item) { $event = $item->getForPage(); if($item->isPublic() && !$events->has($event)) $events->add($event); } $events = $events->find("limit=10"); foreach ($events as $event) { echo $event-title; } echo renderNavigation($events); This gives me the event-titles and pagination, but when I click the next page on the pagination, the page won't change. What should I do??? Another question on this is that the rendering of the event-list on my pages is a bit slow. How should I debug the page rendering time? I would like to know if there is some problems with my pages or with the code. -
That problem has disappeared, but this question remains: Is there any way to get the finnish translation to codemagic without changing the core?
-
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
The selection now is working nice. But how could I then enable the pagination for these events that are now in the $events array? If I try to use limit=10 in the find() above, it doesn't work, because I shouldn't limit the repeaters. -
Thanks, I'll try that.
-
And when the WireException is thrown, how should I handle that in a custom login form? I now get an error 500 and this in the error log, when giving a wrong password to my custom login module: 2013-12-14 00:59:31 guest http://localhost/mysite/members/ Error: Exception: Please wait at least 60 seconds before attempting another login. (in /Library/WebServer/Documents/mysite/wire/modules/Session/SessionLoginThrottle/SessionLoginThrottle.module line 99) 2013-12-14 01:01:28 guest http://localhost/mysite/members/ Error: Call to a member function isLoggedin() on a non-object (line 5 of /Library/WebServer/Documents/mysite/site/templates/member.php)
-
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
Thanks for the fix! I'll take the latest version. Well, the events are concerts that are held many times in different dates with the same program. I am trying to find out how to show a list of upcoming concerts in correct order even though some of the actual concert dates in the repeater have passed the day I create the list. I would like to search all the concerts that have a date in the repeater in the future and sort by that date: $events = $pages->find("template=event,eventdetails.date>today,sort=eventdetails.date"); But I suppose your example will do the trick. I'll try that, thanks! -
Ryan: The Safari problem with menus not showing up was fixed after restarting Safari...
-
I tried to add Finnish translation to TinyMCE plugin codemagic by copying the en.js and en_dlg.js files to fi.js and fi_dlg.js and changing en to fi in those files. Without these files I didn't get the whole field to load. But now I can't get the translations to work even in english. I only see texts like this: {#codemagic_dlg.code_label}. I am using TextareaLanguage fields. What should I try to do? Is there any way to get the finnish translation to codemagic without changing the core? Edit: The translation problem shows up on Mac OS X Chrome 31.0.1650.57, not on Safari.
-
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
That filtering works! Thanks, but still... There shouldn't be any empty items. So I don't understand where that empty item comes from. When trying count($e->eventdetails) I get two instead of one. Why is there two repeaters items even though I have defined only one in backend. And why do I get those two when using find()->sort() and only when when trying to use find(sort=eventdetails.date)? -
Sorting events by date with multiple event dates stored in repeaters
lpa replied to lpa's topic in General Support
Can anyone help me with this? Or should I try to explain this more clearly? -
On Mac OS X 10.6 with Safari 5.1.10 with this latest update when modifying a page the menu (Content, Children, Settings, View) disappears.
-
I have a list of events that may have 1 to multiple event dates. The dates and places of the events are stored in repeaters. I would like to sort my eventlist by date: Event 1 eventdate 1: 1.11.2013 15.00 eventdate 2: 15.11.2013 18.00 Event 2 eventdate 1: 5.11.2013 15.00 Event 3 eventdate 1: 14.11.2013 15.00 eventdate 2: 15.11.2013 18.00 eventdate 3: 16.11.2013 19.00 Event 4 eventdate 1: 17.11.2013 18.00 The repeater for the eventdetails has fields eventdetails.date and eventdetails.place. The event itself is stored with the template "event". I have tried the following: $events = $pages->find("template=event, sort=eventdetails.date"); This gives me an error: Column not found: 1054 Unknown column '_sort_eventdetails_date.date' in 'order clause'. And this: $events = $pages->find("template=event")->sort("eventdetails.date"); This gives me the correct order, but also an empty repeater item with empty eventdetails.date while looping the events: foreach ($events as $e) { foreach ($e->eventdetails as $d) { $o .= strftime("%e.%m.%G %k:%M",strtotime($d->date)).", {$d->place}"; } $o .= $e->title; } Output for event 1 1.11.2013 15:00, place1 15.11.2013 18:00, place2 1.01.1970 2:00, Event 1 What is the correct way to sort by the date field in the repeater? Why do I get the empty repeater line (1.01.1970 2:00) in the second example?
-
Ok, thanks! I just thought I had seen the debug info on front-end too, but obviously not.
-
How to set page name in different languages through the api?
lpa replied to lpa's topic in Multi-Language Support
Thanks, ryan! It works when running the same code from a template-file. BUT I think there is a bug if it doesn't work when bootstrapping. None of the functions I use should have anything to do with PageRender or ProcessPageView. There is only some get, set and save methods used. -
Thanks Adrian, that works. I thought it would come automatically on the front-end too when I define $config->debug = true; But if I want the output on front-end to be as pretty collapsed or formatted as it is on back-end, what should I do? Do I need to define css and js for debugging myself? If so, what is enough?
-
I have $config->debug = true. I get the debug information on the backend but not on the front-end. I am using the Foundation profile from Ryan. What might be wrong?
-
How to set page name in different languages through the api?
lpa replied to lpa's topic in Multi-Language Support
Thanks Ryan! This still doesn't work for me: I am running this, where english is not my default language: #!/usr/bin/php <?php require('./index.php'); $english = wire("languages")->get("english"); echo "Language: $english\n"; $p = wire("pages")->get("/koulutus/"); echo "Page: $p\n"; $p->set("status$english",1); echo "status:".$p->status1013."\n"; echo "Name $english before:".$p->name1013."\n"; $p->set("name$english","education"); echo "Name $english after:".$p->name1013."\n"; $p->save(); echo "Name $english saved:".$p->name1013."\n"; What I get is: Language: 1013 Page: 1163 status:1 Name 1013 before: Name 1013 after:education Name 1013 saved:education But after running this again, Name 1013 before is empty again and in the database it is like this: 1163 1 29 koulutus 1 2013-10-26 23:53:00 40 2013-09-29 16:05:32 40 1 NULL 1 Where name1013 is the second last field with NULL. And I am running the latest dev-version 2.3.5. loaded just today from GitHub. -
Check your root directory for the install.php. It is not in the install directory.
-
How to set page name in different languages through the api?
lpa replied to lpa's topic in Multi-Language Support
Thanks, Soma! It still doesn't set the name1013 field at all. $english = 1013. I just don't understand why. And why couldn't I use this: $page->name->setLanguageValue($english,$lalias_name);