Jump to content

Ferdi Derksen

  • Posts

  • Joined

  • Last visited

Everything posted by Ferdi Derksen

  1. Tnx @neosin for your feedback - I'm currently rewriting the module with a lot of those issues fixed. Also adding a delay time checking for last modified time which is at least half an hour in the past. The preview is also a nice feature which I will take in consideration!
  2. Hi @loukote, Nice to hear that solves some problems. To add the fieldtype "PageTitleLanguage" you can simply add this to the module in file "PublishToTwitter.module" at line 399. Since I'd like to keep the module as simple as is, I don't think this will be added soon.
  3. Hi @loukote, My first thoughts were about that "user" template. This shouldn't be possible, because the module filters all System flagged templates. After installing the same PW and module as you did, I saw that there isn't a filter on the date-field nor title-field which indicates the option to select the "City" and "first name" fields. Those are valid by filtering only on the fieldtypes "FieldtypeDatetime" and "FieldtypeText" for the date field and fieldtypes "FieldtypePageTitle" and "FieldtypeText" for the title field. Since the filtering isn't that great, I added some minor changes to the module. Now it is possible to select the correct fields depending on the chosen template(s). The fieldtypes (as described above) are still used as a selector as well. Please let me know if this works out now.
  4. Hi @loukote, Maybe a stupid question, but you did save the module after selecting a template, right? The list of fields available is depending on the template(s) you selected at the first place. This should indicate the "user" template is selected now. On the other hand, the "date" field is build with a selector for fields of type FieldtypeDatetime or FieldtypeText. Otherwise send/place some screenshots, happy to help!
  5. Hi @benbyf, I'll check for the mention and when needed add it, when you need any extra support, let me know!
  6. Hi @loukote, There is no limitation/filtering in fields of the selected template(s). Therefore those drop-downs are selecting fields with type "Text" for "page title field" and type "Datetime" for "datefield to check for publication" so the checks when Tweeting (or selecting which to Tweet) can be done properly. Cheers, Ferdi
  7. Hi @DL7, First of all I assume you are using the module for version 3.x I think the first thing to change is the 'autoload' option in the getModuleInfo() method to 'autoload' => true (or add another template you are using for the creation of pages). Please let me know if that's working for you. Cheers!
  8. Well in this case I (kinda) solved my issue using an array like this; $selector[] = ['field' => 'date_pub_end', 'operator' => '<=', 'value' => $now, 'not' => true]; I also read the documentation about the array-selectors in the blog and from Ryan but I guess we still have to wait a little bit for the upgraded documentation for this announcement; Tnx anyways @Macrura @kongondo for pointing me in the right direction!
  9. Hello, I'm trying to build a selector array to work with an OR operator. I need all pages where the datetime field ("date_pub_end") is empty or in the future. In a selector string this could be solved with the following two examples (with and without OR-group) $selector1 = "... ,!date_pub_end<={$now}, ..."; $selector2 = "... ,(date_pub_end=''),(date_pub_end>={$now}), ..."; But I'd like it to work in selector arrays, so far I couldn't find a solution.
  10. My guess why PW isn't listed in the most popular CMS systems is because it ain't visible in HTML right away. In my opinion we're lucky about that so any type of hacking is therefor also very limited (look at WP ).
  11. Hi Raulyjo, Maybe you can repost the image - it isn't viewable now. Regarding your problem you might consider merging the VirtualHost options into 1 block and using ServerAlias for the www alias; <VirtualHost *:80> ServerAdmin Raul DocumentRoot "/opt/bitnami/apps/mywebsite/htdocs" ServerName mywebsite.es ServerAlias www.mywebsite.es </VirtualHost> Remember to restart Apache again after changing. I hope this works - but just let it know.
  12. Before you dive into this too deep - I got this working in a module-setup. I'm only interested to get it working without a module (not needed/critical).
  13. Tnx for the input, but unfortunately I didn't get that to work, it results in a fatal error; Fatal error: Call to a member function wire() on a non-object in /mypath/htdocs/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(283) : eval()'d code on line 1 Placed in my ready.php file: $contentWire = new ProcessWire('/mypath/to/content/site', '/content/'); wire('content', $contentWire, true); // using $this->wire.... didn't work Placed in the field PHP code: return $this->wire('content')->wire('pages')->find("parent=/"); I hope you have any thoughts left? Thanks in advance!
  14. Well, that is where I started ofcourse, but you can't use any other variables in the PHP code then $page or $pages ?
  15. True, but I don't want to mix, these pages are only be available in certain cases. Because these fields are only set for a specific template we can get content from another PW installation and won't mix them up with the original installation. Have to say I should have mentioned that indeed. For this purpose only I also set a hook on InputfieldPage::getSelectablePages to be certain we could get the page when the current page has the same ID as in the other installation. // in short I removed this bit if($children && $children->has($page)) { $children->remove($page); // don't allow page being edited to be selected }
  16. I guess you're wrong this time With a hook I managed to accomplish my question. My finished code looks like this: public function init() { $this->pages->addHookBefore('InputfieldPage::findPagesCode', $this, 'findPortalPagesCode'); } public function findPortalPagesCode($event) { if (!$event->object->findPagesCode) return; $event->replace = true; // @TODO check for value in findPagesCode before loading $content so it won't load every time $content = new ProcessWire('/mypath/to/content/site/', '/content/'); if($event->object) {} $pages = $this->wire('pages'); // so that it is locally scoped to the eval if(empty($event->object->findPagesCode)) $event->return = $pages->newPageArray(); $event->return = eval($event->object->findPagesCode); } At the fieldsettings I placed my custom PHP code as selector like this: return $content->find("template=news");
  17. Hi guys, I was wondering if there is an option to load another site in the FieldtypePage by using the custom PHP code to find selectable pages. // placed as custom PHP code to find selectable pages return $content->pages->get("/")->children(); When it needs hooking into methods as "InputfieldPage::___getSelectablePages" or "InputfieldPage::___findPagesCode", I'd like to know how. By just placing the following code somewhere in the methods it won't work, but maybe someone else knows how? $content = new ProcessWire('/mypath/to/content/site/', '/content/'); // placed in subdirectory Maybe it isn't even possible, but then also, I'd like to know .
  18. 0.8.6 : Optional set a prepend text Find out which Twitter-account is connected when saving module 0.8.7 : Supports FieldtypeCroppableImage3
  19. welcome to the club - nice comparison ! Remember to move this block of code into <head> though... <script type="application/ld+json"> .... </script>
  20. 0.8.5: Due to the recent Twitter update changes are made to remove the limitation of media-URLs. In addition there is an option to set the maximum number of images you want to add to the Tweet (when the images-field is set to multiple). Enjoy!
  21. I'd prefer - only once per day though - The rest of the time just silence.
  22. Updated the module to version 0.8.3 for working with PW 3.x (use version 0.8.2 for PW 2.x).
  23. Hi all, Just in front of the Easterweekend, my first contribution to the modules section of ProcessWire. I created a module to send Tweets when selected at the page editor. From version 0.8.3 up the module is only to use in v3.x. When using ProcessWire v2.x you should use version 0.8.2. In short this module offers an option to publish a page to Twitter when the date for publishing is past/scheduled. After filling out the Twitter credentials, select your preferable template(s) which should have the option added to Tweet the pages using it. Additional select the field to use as publicationdate to check if the Tweet should be send now or later, a field which contains the page title. Optional you can fill out the name of the website which will be added after the title (in case space is available). Optional you can select the field where the page image(s) are placed (only one will be tweeted). Optional you can fill out Bit.ly credentials for shortening URLs. Includes instructions to set a cron (template or LazyCron), returns log in assets folder. Uses (included) TwitterOAuth PHP library written by abraham. http://modules.processwire.com/modules/publish-to-twitter/ https://github.com/FerdiAgrio/PublishToTwitter Enjoy!
  24. Hi Martijn, Well, I'm not sure this will do since my code needs the JS library only once. In my case (charts-module ) I need to load the highcharts library only once, but the page (body) can have multiple instances of hanna code; [[chart item=a period=month]] some text here [[chart item=b period=3months]] //and so on... ...and in case we have other hanna-codes in the body/page, I need to make sure my library is already added or if I still need to load it.
  • Create New...