2 posts in this topic
Recently Browsing 0 members
No registered users viewing this page.
I have created a script which will create the pages and it should be unpublished.
I have added the status as unpublished by default while first time saving the page as below.
$hotelPage->hotel_website = $hotel['hotelWebsite']; // By default page created will be unpublished state $hotelPage->addStatus(Page::statusUnpublished); $hotelPage->save(); $hotelPage->setOutputFormatting(false); // Add hotel images only after setting output formatting to false $hotelPage->images->add($hotel['hotelImage']); $hotelPage->save(); On the same time, saving the hotel image as well and triggering the save method.
But when I see the created page in the tree, Its shows unpublished but publish_date is not empty(date will be present as created, modified and published are all same)
Now I don't understand why the date is getting filled into the publish field for a page?
Please let me know if am doing something wrong.
By Michael Steinmann
i guess my php knowledge is not good enough to find a solution for the following problem:
I'm building a website where i have projects. Each project has tags like "webdesign, responsive, cms, print, flyer" etc. At the end of a project i want to recommend other projects, which have similar tags. I want to limit the recommendations to three other projects sorted by the hightest amount of same tags.
This is how far i got:
<?php $interessantes = $pages->find("tags=$page->tags, id!=$page->id"); ?> to find other projects with the same tags, excluding the page i'm already on.
Then i'm using three foreach-functions to go through the projects i found, the tags they have and compare them with the tags of the project i'm looking at. If i have two identical tags, i count up a variable.
<?php // Projects i have found foreach($interessantes as $interessant): $i = 0; // Tags of the projects i have found foreach($interessant->tags as $tag): // Tags of the project i'm looking at foreach($page->tags as $tagreferenz): if($tag == $tagreferenz): $i++; endif; endforeach; endforeach; endforeach; ?> You can see what it looks like in the screenshot with a bit of HTML. I marked the tags of the current project green and the identical tags of other projects red with the amount of hits below. So in this example i would want to have three projects with three similar tags and get rid of those with only two and one.
I guess i have to put my pages into an array (with the number of hits?), sort them and echo them with "limit=3"? Unfortunately i have no idea how to do this. You probably have an even better/shorter solution. Links to other topics are welcome to and i'll try to get my head around it.
If you need further explanation, i'll try my best.
This might sound a bit strange but I am looking for a solution to hook into page edit and remove or disable the two save buttons including their dropdown options.
I managed to partly remove the buttons, but the dropdowns remained. However, I would prefer a solution with disabled buttons but have no idea how to achieve this.
I hope somebody of you can tell me how to remove or disable these buttons.
Thanks a lot in advance
By Cody Connor
I installed the InputfieldCKEditor module and am using the ck editor in all of the fields on my processwire website. I need to be able to drag images into the CKEditor field so I downloaded a CKEditor plugin called simpleuploads put it into /site/modules/InputfieldCKEditor/plugins/ and added the plugin to the field I am working on. I have tried doing it many different ways and the plugins still are not working and I have no idea where to go from here.
I am working with processwire version 3.0.61.
I am using CKEditor version 4.4.2.