Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Update: Runtime Markup Version 0.0.3. Changelog Added support to render PHP, JavaScript and CSS files Thanks to @bernhard for the ideas. Please note: Please read the notes that accompany the field settings. For PHP, you can choose to render files (recommended) vs paste code. JavaScript and CSS work with either PHP rendering method (above). These are optional to use. For each of the 3 file types above, if you only have one file and this is named identical to your field, you can select an option to have those rendered/added. For example, if you have a RuntimeMarkup field called 'my_field', you can have a 'my_field.php', 'my_field.js' and 'my_field.css' automatically rendered/added. However, if you want to render multiple files and/or these are named differently, select the option that indicates the files have different names. In that case, enter comma-separated file names. For example, for CSS: my_css, styles/my-other-css-file. Using this option, you can include external JavaScript libraries for use on your page if you fancied it. The above can be mixed and matched, e.g. PHP file could have name identical to field but JavaScript are multiple files with different names and CSS multiple file names, one of which could share a name with your field. All files must descend from either of the root paths /site/templates/ or /site/modules/. It is OK for files to be in sub-folders, as long as those descend from one of these root paths. There is a setting to indicate root path. Only one root path can be used at a time, i.e. it applies to all file types. .php, .js and .css extensions are assumed and do not need to be specified with the file names. PHP files such as .inc will need to be input as such, e.g. my_code.inc,includes/my-more-code.tpl. Errors will be shown if files not found. In your rendered PHP file, you have access to $page and $pages. This means you do not need to get the page being edited first to use it as the current page. For frontend, only pasted PHP code option is supported. My take is that this module is primarily used for the backend. Use of the render files option is geared for creating complex and/or more flexible backend apps as opposed to frontend usage. I have no intention of changing this behaviour. Currently available on dev branch only. Please test and let me know (with Listers, etc as well, thanks). Screenshots Backend Settings Backend Output
  2. Media Manager version 011 (released 20/07/2017) Happy to announce the latest release of Media Manager. Changelog Fixed bug that caused required Media Manager fields to still be labelled as 'missing required value' even when they were populated.
  3. Interesting solution. On my local/dev setup I use Symlinks as I need to easily test my modules in different PW installs.
  4. Queries locking code be about not setting a 'reasonable' limit to number of pages to return. It could also be about too many joins. Hard to say without know exactly what's going on. These threads should be useful:
  5. Hi @bernhard. Sorry been caught up in other stuff. I will implement your suggestion, albeit slightly differently. Thanks for the docs suggestions as well.
  6. Update: Menu Builder Version 0.1.9. Changelog Added support for multi-lingual menu items (both PW pages and custom ones)! Thanks @Michael van Laar for 'reminder'. Note Multilingual feature only applies to multi-lingual sites. You have to choose the languages you want for your menu items (in menu settings). Multi-lingual feature only applies to menu items. This means menu titles themselves remain as normal. The feature only applies to menu item title and URL If other language's item title or URL are left empty, in the frontend, these fallback to default language's title or URL respectively. This means, for other languages, you can have, for example, a German menu title but leave the German URL blank. In that case, assuming the default language is English, the German menu item will get the English URL. Currently available in dev branch only. Please test and let me know, thanks. Screenshots Backend Frontend
  7. Dynamic Selects version 005 (released (16/07/2017)) Glad to announce that the latest release of Dynamic Selects is now available for Download/Purchase. Changelog Dynamic Selects is now fully multi-lingual! Thanks @eelkenet for reminder . Relevant fields and labels now shown in user's language if available, with fallback on default if not. Screenshots Backend Dynamic Selects Fields Demo Backend Dynamic Selects Page Edit Frontend Dynamic Selects
  8. How are you including it? What's your code? Where is the location? For a file in the same location as the module, the following should suffice: $dir = dirname(__FILE__); require_once("$dir/FileToInclude.php"); #require_once("$dir/someFolderName/FileToInclude.php");// if in a folder This way, __FILE__ will deal with paths rather than you.
  9. Hmm. What version of PW? It shows for me in 2.7 and 3.0.62.
  10. Another trick as mentioned by @Robin S somewhere I now can't find...Hover your mouse over the field's collapse/uncollapse arrow...the name of the input usually matches the API...
  11. Hi @eelkenet. Thanks for the purchase. Yes I am. This will be added in the next version. I'm working on it for the next couple of weeks. Thanks
  12. Welcome @Mirza, If you are talking about the backend, only supersusers have access to setup/template/. No other users can edit templates, fields, modules or admin pages.
  13. I think it should be easy enough to just create a new menu item, no? I see no easy way of automating this so will have to let the idea go.
  14. Hi @Sahil, Sorry I never resolved this. It's difficult to give an answer without getting more information about your pages tree structure.
  15. Sorry for late reply @CodeCoffeeCode, In addition to the suggestion to use the custom menu render strategy as suggested by @elabx, I think the options: include_children and current_class_level should also cover what you need. https://github.com/kongondo/MenuBuilder/tree/dev#options Please let me know if this solves your issue.
  16. Hi @alan, Hope it's not too late to reply. Sorry I missed this! It is possible but the how would depend on the condition you want to check for to decide whether to output the whole menu or just part of it. There are at least two solutions: Using their IDs, remove unwanted menu items from the array or object returned by getMenuItems(). This would probably cost a bit more in memory, but probably nothing to write home about Modify the menu function in the gist you've linked to, to filter out IDs of unwanted items. It should suffice with creating an array of unwanted parent IDs. The, in the recursive function, check, for example if(in_array($m->parentID, $arrayOfParentIDs)) continue;. This is pseudo/incomplete code. You would also need to account for menu items without parents, etc. If you gave us more info (condition to check for), I can give you a more clear answer.
  17. Hi @LMD. Sorry about that; forgot about it. Pushed a fix to the dev branch. Please check and let me know if it works for you. Thanks.
  18. Update: Menu Builder Version 0.1.8. Changelog Added support to disable menu items + related (required for this) permission 'menu-builder-disable-items'. Thanks @cjx2240 Support not to show menu items (pages) not listable to current user. Needs option 'check_listable' => 1 in $options Array. Thanks @Peejay 'current_class' now also applies to Breadcrumbs as well. Thanks @Jonathan Lahijani Note Disabling a menu item cascades the status to all its descendants. In Build Menu view (backend), disabled items displayed with strike-through. Currently available in dev branch only. Please test and let me know, thanks. Screenshots
  19. Technically, nothing is stored in a page, but a field. 10,000 rows of entries in one field is nothing really. MySQL can easily handle millions of rows. The crucial question is usually how you are going to query those rows in a fast and efficient manner. One can't and shouldn't query all the rows. Instead, it usually boils down to using a combination of limit (number of queried rows) and caching. Welcome to the forums .
  20. Update: Merged dev 2.4.1 to master. Changelog New, cleaner Backend UI. Better sorting of Posts, Categories and Tags in their dashboards. New option for posts: post_edit. Allows top or bottom placement of link to edit post for logged in users or non-display of link for all users. Thanks @antoiba86 Code refactoring. Screenshots in this post:
  21. $articles = $pages->find('template=article, sort=-published, limit=10');// latest first //$articles = $pages->find('template=article, sort=published, limit=10');// oldest first foreach ($articles as $a) { echo $a->title . ': ' . date('d F Y', $a->published) . '<br>'; } Is that what you are looking for?
  22. Maybe something like this? $news_member = $pages->find("template=news, body*=$page->title, publish_from>=$year, sort=-publish_from, limit=10"); $content = ''; $newBadge = "<span class='tag is-success'>New</span>"; $lastMonth = 'SomeDate'; if ($news_member->count()) { foreach ($news_member as $n) { if($n->publish_from>=$lastMonth) $content .= $newBadge; $content .= "<p><a href='{$n->url}'>{$n->title}</a></p>"; } } Untested.
  23. Welcome to the forums @fabjeck. If you are using native ProcessWire published page property: echo date('d F Y', $page->published);// e.g. 07 January 2017 I can't remember when 'published' property was added to ProcessWire, but hopefully it should work in the version you are running.
  24. It should, though I don't know how to make it switch to ListerPro....not sure it would be automatic.
×
×
  • Create New...