Jump to content

gebeer

Members
  • Posts

    1,554
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by gebeer

  1. Looks like a .htaccess RewriteBase issue to me. Try to play with the settings in .htaccess around line 115 - 125.
  2. Hi Phil and welcome to the forum! I remember that I had a similar problem one time at the beginning with PW. It most likely is caused by some missing closing tag or other html syntax error. Hard to tell without seeing code. If you can supply your main.php, we can have a look.
  3. I am working on a similar scenario where mobile clients are sending and getting data to/from PW. My approach was to implement a RESTful service. I am using clsource's REST helper class and it is working fine. But it is not really a simple solution. There also is Ryan's Pages Web Service module. But I'm not sure if you can use it to push data from the client to the server.
  4. Came across this thread through the latest PW newsletter issue. Currently I'm working on 5 different projects with PW. Most is rather simple stuff regarding complexity of site structure. One site is for the Universal Healing Tao Foundation of Grandmaster Mantak Chia and shows the organizational structure of the world wide foundation. To visualize the structure I am making my first steps with D3 JS which is a lot of fun. I created an SVG world map with data for all countries and continents and connect that map to data of people that are active in the foundation and hold various positions in their country. The site is based on my Bootstrap/Fontawesome SASS site profile. The current dev status can be seen here. One of the more complex sites has an extensive frontend user area where users can manage their sound servers and publish advertisements to their servers which will later be displayed on mobile devices that are connected to the servers. Quite complex forms with PDF to image conversion on upload etc. that I am building with the PW form API. This site is also dealing with data exchange between PW and mobile devices where the mobile devices connect to PW through a RESTful API to send and get data. Doing this the first time and, honestly, I don't know if I would have had the confidence to take on the project without having PW as the perfect tool at my hands
  5. @horst makes total sense.
  6. Did you already try to change your hook event from 'save' to 'saveReady' ?
  7. @LostKobrakai Thank you for clarifying and giving insight on the inner workings of images/file fields.
  8. Have you tried $page->article_visual_snippet->add("path or URL to image") instead of $page->article_visual_snippet = URL. Not sure if it will make a difference, but maybe worth a try. And you can try to hook on saveReady instead of save. Is article_visual_snippet a single image field or should it hold multiple images. If only 1 image, you could set Maximum files allowed to 1 and Formatted value to 'Single Item (null if empty) and do if($page->article_visual_snippet){... instead of if($page->article_visual_snippet->count() < 1)
  9. As of 2.6.5dev there are these neat extra action buttons 'unpub', 'hide' etc in the page tree. In ListerPro we can define our own actions as modules that extend the new PageAction class. Ryan mentions in the ListerPro forum that the page actions are a new feature of PW and that they are independent from ListerPro. It would be great if we could define our own page actions and attach them to the page tree or to lister results. Looking at the code I am not quite sure how we can achieve that through a hook or the like. So for all not so code savvy PW "hookers" (pun intended) it would be great to get some documentation on this new feature.
  10. No need to feel sorry at all I didn't take any offense from your post. Guess, you took a look at that list for a reason. If that reason is you having to setup a WP-site then I feel sorry for you. (Now I'm being the WP-basher ) @tpr I really like your constructive approach to the topic
  11. There is quite a lot of WP bashing going on here in the forums. I can totally understand the reasons for that and agree with most of what is being said. What I don't understand is why people feel the need to go into this over and over again. No offense intended here. I think that in the long run people who responsibly build and maintain websites will eventually move away from WP to other platforms like PW. I introduced PW to an agency that I'm freelancing for and since then they started to do most of their projects with PW. Seeing the fast growing PW community also indicates that people are able to make choices based on their experience with other platforms and what they see can be achieved with PW. From an energetic point of view it is preferable not to put your energy into something that you don't want or like. Any energy that we put into those things will most likely help to support them even if we don't intend to do so. So I just leave WP be what it is and concentrate on all the wonderful things that I can do with PW
  12. ProcessWire API has methods for session handling: $session To set your custom session variable you can use $session->set($name, $value) or $session->$name = $value and later retrieve it with $session->get($name) or $session->$name So in your case it would be if($config->ajax) { $session->test = "test"; } Here test will only be set if you make an ajax call to the page. From your question it is not clear whether you made that ajax call before trying to get the test value on a normal page load. To retrieve the value you can use $test = $session->test;
  13. In your inline style you are missing the url() part. And the api call to the image is also not correct. Is the image field storing only 1 ore multiple images? If it is multiple, you need to do something like <div class="thumbnail"> <a href="..."> (Link to my gallery) <div class="flex-item6" style="background-image: url(<?php echo $page->images->first()->url; ?>)"> <span class="overlay">stuff</span> </a> </div>
  14. I found a cleaner way of adding modals to $jsConfig. Instead of writing out the whole array, we can do: $jsConfig['modals'] = $config->modals; This way also changes to the core get picked up.
  15. Just wanted to note here that with PW 2.6.x the pwimage plugin stopped working. So I couldn't insert images in CKEditor anymore. I discovered that in the config json array with PW 2.6 a element "modals" got added (through /wire/config.php around line 848). You need to add this to the $jsConfig like: <script> <?php $config = $this->wire('config'); $jsConfig = $config->js(); $jsConfig['modals'] = array( 'large' => "15,15,30,30,draggable=false,resizable=true,hide=250,show=100", 'medium' => "50,49,100,100", 'small' => "100,100,200,200", 'full' => "0,0,0,0", ); $jsConfig['urls'] = array( 'root' => $config->urls->root, 'admin' => $config->urls->admin, 'modules' => $config->urls->modules, 'core' => $config->urls->core, 'files' => $config->urls->files, 'templates' => $config->urls->templates, 'adminTemplates' => $config->urls->adminTemplates ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> Then the modal popups for inserting images will work again. See also my thread about pwimage plugin in frontend forms.
  16. After an upgrade from 2.5.2 to 2.6.3 my setup stopped working I cannot choose and insert images anymore in my frontend form CKEditor field with the pwimage plugin. If I click on the insert image button in the editor toolbar, nothing happens and it throws a js error: It seems the way the pwimage plugin works changed significantly. I guess I need to load some additional scripts in the frontend to make this work again but I can't seem to find what is missing. Any help would be much appreciated. EDIT To make frontend forms work, I added this to the head: <?php if ($user->isLoggedin()) { ?> <script> <?php $jsConfig = $config->js(); $jsConfig['urls'] = array( 'root' => $config->urls->root, 'admin' => $config->urls->admin, 'modules' => $config->urls->modules, 'core' => $config->urls->core, 'files' => $config->urls->files, 'templates' => $config->urls->templates, 'adminTemplates' => $config->urls->adminTemplates ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> <?php } ?> This outputs a JS config variable in json format. When I compare the output of config from the admin page edit source to my frontend page edit source, I find that following part is missing in the config json on the frontend: "modals": { "large": "15,15,30,30,draggable=false,resizable=true,hide=250,show=100", "medium": "50,49,100,100", "small": "100,100,200,200", "full": "0,0,0,0" }, "JqueryWireTabs": { "rememberTabs": 0 }, Now what do I need to add when building the json via PHP so that this gets included also on the frontend? EDIT2: I think I found it. In wire/config.php around line 848 there is $config->modals = array( 'large' => "15,15,30,30,draggable=false,resizable=true,hide=250,show=100", 'medium' => "50,49,100,100", 'small' => "100,100,200,200", 'full' => "0,0,0,0", ); I added this to my code so it now reads: <?php if ($user->isLoggedin()) { ?> <script> <?php $config = $this->wire('config'); $jsConfig = $config->js(); $jsConfig['modals'] = $config->modals; $jsConfig['urls'] = array( 'root' => $config->urls->root, 'admin' => $config->urls->admin, 'modules' => $config->urls->modules, 'core' => $config->urls->core, 'files' => $config->urls->files, 'templates' => $config->urls->templates, 'adminTemplates' => $config->urls->adminTemplates ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> <?php } ?> And, voila, the modal for selecting images is now working again on my frontend form
  17. I updated my site from 2.5.2 to 2.6.3 with the ProcessUpgrade Module. When updating InputfieldTime (also through ProcessUpgrade Module) I got a worning that it is not compatible with 2.6. I went ahead anyways to see what will happen. After upgrade I got 2 Warnings: and a message: InputfieldTime was updated successfully. Button: Continue to module settings In the module settings I got: There are multiple copies of this module. Select the module file you want to use. /site/modules/InputfieldTime/InputfieldTime.module (the new one after update) /site/modules/PW-FieldtypeTime/InputfieldTime.module (the old one) I chose the new one. Then I did the same for Fieldtype Time module. Everything seems to be working fine with 2.6.3 Just wanted to let you know.
  18. Thank you, Ryan, for looking into this. Yes, they occurred immediately after each other.
  19. Yeah, stupid me Forgot that $images will be altered after removing. When I do $images = $page->images; echo count($images) . " images<br>"; foreach ($images as $img) { echo $img->basename . "<br>"; } $firstimage = $images->eq(0); echo "firstimage<br>"; echo $firstimage->basename . "<br>"; $restimages = $images->remove($firstimage); echo "restimages<br>"; foreach ($restimages as $img) { echo $img->basename . "<br>"; } everything works as expected
  20. Hi All, I have an images field for multiple images set to always return an array. My images field holds 5 images. I'm trying to get the first image of the array and then remove that to get an array that holds images 2-5. Here's my testing code so far $images = $page->images; $firstimage = $images->eq(0); //also tried $images->first() with same result $restimages = $images->remove($firstimage); echo count($images) . " images<br>"; foreach ($images as $img) { echo $img->basename . "<br>"; } echo "firstimage<br>"; echo $firstimage->basename . "<br>"; echo "restimages<br>"; foreach ($restimages as $img) { echo $img->basename . "<br>"; } And here's the output: 4 images mario_florenz_1.jpg mario_florenz_3.jpg mario_florenz_2.jpg mario_florenz_5-1.jpg firstimage mario_florenz_4.jpg restimages mario_florenz_1.jpg mario_florenz_3.jpg mario_florenz_2.jpg mario_florenz_5-1.jpg A few things that buffle me: -count($images) returns 4 where it should be 5 -foreach through $images returns only 4 images where it should be 5 -$images->eq(0) returns the first image but this one is not returned when I loop through all images -$images and $images->remove($firstimage) return the same I really don't understand what is happening here. Reading through the API docs on images and WireArray manipulation it seems my code should work. Any help would be much appreciated.
  21. Welcome to the forum, mosid! Here is a discussion about RESTful API in PW where Ryan shares his thoughts about it. And there is Ryan's module Pages Web Service. I don't think it needs to be in the core. Thanks to PW's modular structure it is easy to implement.
  22. You're welcome. I'm happy that this is of use for someone
  23. Thank you, Soma, for clarifying.
  24. I was not sure from your first post whether you just wanted to collapse the field when empty. That is why I included those instructions. Further down in my first post I describe that I have the same behaviour here on a 2.5.29 dev site with multi language setup. This is to confirm your problem. Looks like a bug to me. Maybe you want to file an issue at github.
  25. You don't need dependencies for this to work if you want to show the image_field itself only when there are images. In the field settings for your image_field go to input tab -> visibility and choose "Collapsed only when blank". This should do what you want. EDIT: I just tried this on a 2.5.29 dev install and I can confirm that it is not working as expected. I have a field images and a field bodycopy. For bodycopy I choose "Show this field only if..." images.count>0 The bodycopy doesn't show at all, no matter if there is an image in the images field or not. The field is there in the HTML with an attribute data-show-if='images.count>0' in the field wrapper. Maybe the JS cannot compute the >0 part. But this is just a guess and needs further investigation. Should we file this as bug? EDIT2: I tested this in a multi language setup. In the dependencies documentation section limitations it says Do you also have a multi language setup?
×
×
  • Create New...