-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Custom Code for selectable pages not working properly
Soma replied to vknt's topic in General Support
Even more confused. But now I know, I did something wrong, I did a find for hidden pages, and forgot to include=all... Your're right it does work, but with the limitations you mention. I'm not sure, how flexible it should be but you could do something like this: $p = $pages->get("/sidebar-elements/")->children(); foreach($pages->get("/polls/")->children() as $c) $p->append($c); return $p; -
Custom Code for selectable pages not working properly
Soma replied to vknt's topic in General Support
Apeisa, actually it works, I tested it before posting. But I think I messed up, you're right. But using get("/")->children() instead would work. EDIT: I'm confused, apeisa method doesn't work, just tested. Returns "Call to a member function children() on a non-object" even when using ->first(). I'll let Ryan answer here. -
Custom Code for selectable pages not working properly
Soma replied to vknt's topic in General Support
it should be return $pages->get("/")->find("...")->children("..."); -
Just noticed a typo in my code it should of course be: <?php if($page->poll) { echo $page->poll->render(); } ?> But I think you noticed that too? cause it wouldn't have outputed something at all with $poll->render(); If it still does not work, you're doing something wrong in setting this up all. Not sure how I can further help without seeing the code and field/template setup. 1. I 100% think you forgot this: Make sure the poll page select field is set to allow single pages only (like I mentioned in my previous post). Having different setup wouldn't work since it would return page array when with multiple. You would have to change my code to $page->poll->first()->render(); I think. <?php if(count($page->poll) > 0) { echo $page->poll->first()->render(); } ?> 2. The Poll1,Poll2 uses template that has code from ryan, thats going to render. I have set up a testcase locally within 5 minutes and it works well.
-
Exactly how you're doing it already and how I explained. I'm a little confused. To clarify again. You have a page field named "poll". This is set to allow only 1 page reference "Single page (Page) or boolean false when none selected", and set parent to be the parent page "Poll" containing all the polls (Poll1,Poll2). Then, on page you select the poll you wish to output like --Poll1. So you got 1 Poll selected, and in the template of the page there would be this code: <?php if($page->poll) { echo $page->poll->render(); } ?>
-
Not sure where you got problems. I assume you have created it with the code of Ryan on this page further above? You can use this code as is, just insert following before $answer->save(); <?php $answer->setOutputFormatting(false); Make this code of Ryan a template "poll.php", in PW this will be the poll (question) template, containing the answer pages later. Now, you already got your reference page field called "poll" or "poll_selected". So on the template that uses this field to select a poll, you could make it like the following using the "render" method. This is a module under "Page" section called "Page render" you need to install in case you haven't already. This adds render method to all pages. Now using this method it's as simple as: <?php // output poll where you want in you page templates if($page->poll_selected){ echo $page->poll_selected->render(); {
-
Welcome Mickael, that can happen and not always depends on the subject/content of the email but on the email filter of your mail server, some mail servers mark them as spam when first time reciveing email from a unknown domain, once you accept it will not be spam anymore. Not sure what you're talking about. Do you mean an image itself? TinyMCE does support drag and drop of images, though it get inserted as base64 encoded url string. Undo and redo, isn't implemented in PW, but you can add button in TinyMCE for that. If inserting an image in TinyMCE using PWs image dialog, it inserts and new resized version of the image. That's why we all love PW Frontend stuff is easily possible depending on your php skills, search through the forum, theres some threads concerning front end implementation of forms. Since there's different ways to do such thing usually, you should first get familiar with the system and ask and search in forum. I think there will be at some point exists modules for doing things more easy on frontend as this is what many poeple have been asking. That's true, it is great feature! - See respond above. That's again why we all love PW for what it is! Thanks, Soma
-
I see. I went through this and tried something which works converting php to jquery ui format. Since datepicker doesn't support time output, you gonna use datepicker only for years months days anyway. Thought it's possible to break it, but most reasonable cases work. It wouldn't be perfect but at least a little closer. <?php $replace = array( 'd'=>'dd', 'D'=>'D', 'j'=>'d', 'l'=>'DD', 'N'=>'', 'S'=>'', 'w'=>'', 'z'=>'', 'W'=>'', 'F'=>'W', 'm'=>'mm', 'M'=>'M', 'n'=>'m', 't'=>'', 'L'=>'', 'o'=>'yy', 'Y'=>'yy', 'y'=>'y', 'a'=>'', 'A'=>'', 'B'=>'', 'g'=>'', 'G'=>'', 'h'=>'', 'H'=>'', 'i'=>'', 's'=>'', 'u'=>'', 'e'=>'', 'I'=>'', 'O'=>'', 'P'=>'', 'T'=>'', 'Z'=>'', 'c'=>'', 'r'=>'', 'U'=>'' ); $str = "Y.m. l H:i:s"; $out = str_replace(array_keys($replace),$replace,$str); $out = preg_replace("/^((?![a-zA-Z]).)+/", '', $out); $out = preg_replace("/((?![a-zA-Z]).)+$/", '', $out); echo "PHP to jQ UI dateformat: '$str' => '$out'<br/>";
-
I'm not sure what you mean with input/output exactly anymore. I think there's a missunderstanding This is exactly what's needed to solve the problem here with datepicker. You can display the date in a user defined format (visible to the user), while have a different format output to a hidden field and use only that to save it to db. I've done it myself in apps, so I see no problem with this approach. Quoted from jquery ui doc: "The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function" http://jqueryui.com/demos/datepicker/#option-altFormat EDIT: ah, do you mean by format, what the user defines in PW field setting like d/m/y isn't compatible with ui datepicker format?
-
I don't know if that makes sense. Datepicker is highly flexible... how about something like this? http://jqueryui.com/demos/datepicker/#alt-field You can display alternates, and may have a input hidden field thats used to save it using iso.
-
Ah now I get it, there's "input" setting too. Didn't see that before. So this makes sense, and works no matter if i enter manually with slashes or dashes.. strtotime does recognize them all. But using jquery datepicker is not right. There's options to configure ui datepicker. SO if selecting a date it enters in the way you define it. I worked with it a few times and I see no problems with doing it. The way it is now, it populates the field with a standard date like "2011-10-09" which does work and gets transformed when saving, but would be nicer to have it populate the way you defined under input settings. But maybe I'm getting it wrong with what's behind it in PW. Would strtotime not work when implementing this because it doesn't know which is d and wich is m? Is that the ISO format you're speaking about?
-
No Ryan this is just a normal gallery script like if you were using fancybox or any other. If it would be a service like embed you wouldn't need to enter each image with paths into text, instead just put a embed link. That's why I see little problems using this approach. Certainly nothing wrong here, but not ideal.
-
Thanks, I just tried out. I think the behaviour is a bug or by intention. Ryan would have to confirm this though. I would agree that it is strange to use this way. No matter what you specify in the details setting. When on page editing it shows info text: "m/d/Y" , but when entering, it is only valid with something like 10-08-2011. If you use the datepicker it works, just not the way you would expect. The output at template using echo $page->datefieldname; though it outputs as you defined in settings.
-
Hi and bienvenido diegonella You should be able to define format in the field details setting. Once you created the datetime field and save there is more options on top tabs. look for "Details"...
-
Just looked at it. Great so far, but a few things to consider. There's gazillion possibilities anyway how to implement a gallery, but I would never implement a gallery this way in PW or other CMS. Thats what PW is strong in, having images field with description field already, sorting, resizing, etc... Outputting them in the template is as easy as it can get with little php. You could combine it with having an images field to upload images, and then only put a [galleria] in the body text where you want it to render. Usually a gallery is something I don't want to hard-code into a textarea using tags with image path etc. So depending on what you want and need, this works and might be ok to use, but I would definately not recommended it. Also consider these things: What if you need description per image? How is resizing images/thumbs handled? Looking at your code. Use following for get paths to your module.. as it might doesn't work with other installations/paths the way you done it. <?php $this->config->urls->Galleria . "themes/classic/galleria.classic.min.js";
-
Ryan that's exactly the combination I'm facing with a website hosting I need to do a relaunch. I installed PW and got the same error, so I figured out that save_mode is on. That's why I was asking this. Having only faced 2-3 such configuration yet in all the years from friends... I for myself decided to simply tell the owner to change hosting provider. Everytime it got chaotic and it took them ages and 1000000 emails to get them the configuration only nearly right. Often they are shared hostings with php running as a module to save money and have no clue.
-
Do you have debug mode on? In your site/config.php ... There might be more errors showing. Not sure what the problem could be. Safe Mode on/off? in php? Have you manually uploaded the pw folders over ftp , so ftp user/group permission doesn't allow php to write in even if 0777... there can be many reasons.
-
Is this intended? When create a page and leave it unpublished it still can be accessed and viewed on frontend. Just recognized it's only when I'm logged in.
-
Hello landitus, not sure, are you using latest PW2.1? There used to be such an issue which was fixed. Any more infos you might can give can be helpful.
-
I'm also using this bramus cssextras and it's great an easy. I will soon work on extending the tinymce inputfield config in PW and incorporate this plugin too. the content.css is just for display in the wysiwyg. usually your sites css. all you need to is 1. add bramus_cssextras to the plugin string in PW 2. add buttons bramus_cssextras_classes,bramus_cssextras_ids to string in PW 3. add your custom selector strings to the inputfieldTinyMCE.js config like bramus_cssextras_classesstring : "li::ul[smallList,bigList];img::self[floatLeft,floatRight]", bramus_cssextras_idsstring : "p::self[introText]", done, but that all well explained on the plugins website.
-
Thanks Ryan for the quick fix. Just tested and works fine. Just noticed when I set the flag to not be able to move, I still see the "move" action int he page tree.
-
Welcome 1234 and 5j That's how we like it, first post, first module! Thanks for contributing to PW, will surely check this one out soon. Thanks, Soma
-
The configuration per tinymce inputfield is awesome, it would be even more, if I could specify a lot more that tinmyce has to offer, not just buttons and plugins. It would be cool to have possibility to enter custom init setup to easily add templates, custom formats, other theme etc. Are there any plans extending this? As for now I have to change core to archive this.
-
Thanks adamkiss for the suggestion! Thanks Ryan for the insight, awesome. That would be a nice to have feature. The client already asked if there's a way. Good to know it will come soon.
-
Would this be possible with the current PW? I sense that it's not possible yet but know it's on the roadmap. Would it require to have versioning done first, or could there be some trick to archive this? A link opening a window showing the current edited unsaved content? Guess it's not that simple.