-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
I am too lazy to type code... Have a look at the examples found here (second example there has 6 random images being returned) https://processwire.com/talk/topic/328-grabbing-a-random-image/
-
Update: Version 2.3.7 Following this question, it is now possible to pass MarkupPagerNav options to renderPosts() if you wish to customise your posts' pagination. All the MarkupPagerNav options listed here can be passed as an array within an array to renderPosts() as shown in the example below: $blog = $modules->get("MarkupBlog"); $paginationOptions = array( 'nextItemLabel' => "Forth", 'previousItemLabel' => "Back", 'listMarkup' => "<ul class='MarkupPagerNav Zurb pagination'>{out}</ul>", 'itemMarkup' => "<li class='{class} not necessary class'>{out}</li>", 'numPageLinks' => 5 ); $options = array( 'post_pagination' => $paginationOptions,// array of markup pager nav options 'post_count_text' =>'Article',// other posts options passed as normal ); echo $blog->renderPosts("limit=5", true, $options);
-
@congomonster, I suppose you are using the pagination that comes with renderPosts(), which is actually coming from the module @LostKobrakai has mentioned. I've added an option in renderPosts() that will accept an array of options to pass on to MarkupPagerNav. Will post an update within the hour
-
Two things: You never need to change the code in the module itself! Otherwise, your changes would be overwritten with upgrades You don't need this code to be like this: $renderComments = $blogConfigs['commentsUse'] == 1 ? $blog->renderComments($page->blog_comments, 0, $options) : ''; If you read the comments in the demo blog-post.php template file, it says The blog demo could not know in advance whether you or anybody else was going to install Blog with the comments feature enabled/disabled. Hence, it had to make that check by looking into the module configs ($blogConfigs). In your case , you know if you installed blog with the comments feature or not, so no need to make such a check. Hence, use the other code I provided instead, i.e. $options = array( 'comments_post_text' => 'My Text for Post-a-Comment', 'comments_list_empty' => 'Nobody has dared to comment on this article...yet', 'comments_empty' => 'Are you sure you want to be the first to comment?' ); $blog = $modules->get("MarkupBlog"); // Here, no need to check if blog was installed with comments feature; you should know - you installed it yourself $renderComments = $blog->renderComments($page->blog_comments, 0, $options);
-
Process module with certain permission not showing up
kongondo replied to owzim's topic in Module/Plugin Development
I also don't get the 'template file' is needed bit. I couldn't find where that behaviour is defined. If possible, I would want that not to be necessary. -
Process module with certain permission not showing up
kongondo replied to owzim's topic in Module/Plugin Development
I had to hit the 'refresh' button a couple of times for changes to show up (rather than uninstalling ) -
Thanks. Will appreciate your professional opinion especially regarding the client-side-image resizing
-
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
-
Here's the vimeo version. Cannot get 1080p quality unless you are on the paid plans, but its viewable. I don't think am uploading to vimeo again...this was the first and last time. It takes forever and they restrict the quality, tsk.
-
...I have started the 'slow' upload to vimeo... ....
-
For a minute there I thought you were kidding. Never heard of this German GEMA & SME thing. I have just quickly read up about it. Well, I could try upload the video to Vimeo (would that work?) or you could do me a favour and watch the YT one behind a proxy ...that's not illegal, or is it? Edit: There's also the 'original' demo at Blueimp
-
@congomonster, Sorry this is one of those things that hasn't yet found its way into the documentation. Almost each method in MarkupBlog accepts options to alter its output. For the example you've given, that would be an option in renderComments(CommentArray $comments, $limit = 0, Array $options = null). Within the method, the $defaultOptions are as listed here. The option responsible for 'Post a comment' is 'comments_post_text' => $this->_('Post a comment'), . An example of passing options to the method: $options = array( 'comments_post_text' => 'My Text for Post-a-Comment', 'comments_list_empty' => 'Nobody has dared to comment on this article...yet', 'comments_empty' => 'Are you sure you want to be the first to comment?' ); $blog = $modules->get("MarkupBlog"); $renderComments = $blog->renderComments($page->blog_comments, 0, $options); $content = $blog->renderPosts($page) . $renderComments; echo $content;
-
Process module with certain permission not showing up
kongondo replied to owzim's topic in Module/Plugin Development
Got to the bottom of this (I think). Let's say I have a module called ProcessMyModule that has a page called myModulePage that uses the template admin and has the parent admin. That module will display just fine in the admin menu and be visible to users with the permission attached to ProcessMyModule If I add a child page to the page myModulePage, say, myModulePageChild, that uses a template abc, my ProcessMyModule will disappear from the admin menu. The only way to get it back is to (i) enable 'view and edit access' in the template 'abc' [the Access Tab], and (ii) ensure that 'abc' has a template file. So, in my case, the reasons why my ProcessModule was not visible in the admin menu is because its admin page has child pages and those child pages had a template without a template file + without 'view-edit' access enabled.The same thing happens with ProcessMenuBuilder since its admin page has child pages. In the case of ProcessBlog though, its page has no child pages, hence works fine. -
Process module with certain permission not showing up
kongondo replied to owzim's topic in Module/Plugin Development
In my case there are no typos. If I change the parent of the process module to be 'setup', it shows up under setup menu. If I change its parent back to 'admin', it doesn't appear. Totally confounded by this one. I've cleared cache and all... -
Update: Merged dev 2.3.6 to master. This version makes it possible to use CKEditor to create Quick Posts
-
Process module with certain permission not showing up
kongondo replied to owzim's topic in Module/Plugin Development
Ha...I had the exact same question . A process module I am working on is not appearing in the menu, even when I remove a permissions requirement. It works practically the same as my ProcessBlog module, the only difference being that Blog shows up in the Admin menu for users with role 'blog' but in the case of this other module, similar to your case, the module doesn't show up in the Admin menu! -
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
And we are all up . Initial versions of dev and devns are both up now. Don't worry, I won't be giving a running commentary every week! Needed to test that everything works smoothly and so far no hiccups. -
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
In case you haven't noticed, you can shift+click to select a block of code lines, or ctrl+click to select multiple lines. Also, the left side menu just doesn't list the classes, but functions and interfaces as well. Really cool. I have been trying to find a way of displaying the full version numbers of each branch with the docs but haven't found way. For now, if you want to know the version, just scroll or search for the Class ProcessWire. and look at the constants summary table. -
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
Update: Theme Switcher + remake of dark theme OK, because you all asked nicely, and because I don't want @teppo's eyes aching (although he might have been looking at my theme through his cool sunglasses ) and because I don't want @horst to feel 'Ough', I have hurried this up . OK, jokes aside... Theme switcher now included (quite a trivial thing really). The default is the light theme that ships with APIGEN (actually, it also has a Bootstrap theme that it ships with). If you prefer the dark theme (I've gone easy on some colours), just click on the dark box. It will set a cookie and remember you...for a whole year!! If on the light theme, no cookies for you, sorry . When I get time I will write those EU cookie thingys. Something like 'if you are visiting me and would like to stay in a room surrounded by cool, then you must accept to eat my cookies! What do you mean you don't like my cookies? What's wrong with my cookies!? If you don't like my cookies then you stay in the light room'....OK, a bit OTT there (I had a WillyC moment, but failed miserably...am trying too hard, I know )... Btw, there's the occasional flash of 'light theme' when surfing using the dark theme. Am not too bothered about it so will let it be for now.. Anyway, update's here! Later.. -
@Tony, It seems you are using (or copied from) the demo template files that are optionally installed with Blog. In this particular case we are dealing with blog-post.php. The code that generates that sidebar is found between lines 24 - 35. The method spewing out the markup is renderNav() (line #35). As a quick btw, the general rule of thumb is rather than using CSS to hide markup, first check if it is possible not to output that markup in the first place . In our case, it is possible. Line #31 of the code is what is outputting the Author's name and URL. All you need to do is comment out that line, as well as earlier variables building up towards that code, i.e. lines 25 ($authorsURL), 27 ($authorURL) and line 28 ($authorName). I'm not sure you've seen my earlier posts about documentation (it is a long thread after all), but I used to have Blog's documentation hosted on my website, which is currently in deep hibernation until I get time to revive it. Thankfully, the good guys over at wayback machine archived my now asleep and offline website including all the Blog tutorials. These can be found here and the documentation for renderNav() is here. As you'll see, you can use renderNav() to output all sorts of stuff. Hope this helps
-
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
It works just fine ...but not always as, .....erm, clearly stated here -
ProcessWire ApiGen (dynamic + up to date + all branches)
kongondo replied to kongondo's topic in API & Templates
Nice line about potential future changes. Added it to the readme The whites make my eyes ache . I'll look into setting up a theme switcher. -
I have started a project that fully automates the generation and regularly updating of ApiGen docs for all currently maintained ProcessWire branches...More info here
-
Managed to get round to this; fully auto-generated and regularly updated ApiGen docs for all currently maintained ProcessWire branches...More info here
-
Finally, I got spared some time to work on a project I have been meaning to do for a while. This follows on from this request and other discussions about the pros/cons of an ApiGen for ProcessWire. I am all for such docs as long as two conditions are met: (i) That it is clearly indicated who the target audience is; and (ii) that the docs are regularly updated. I think this project meets both. I have created a GitHub project and project pages for hosting regularly auto-updated PHP ApiGen Docs for ProcessWire 3 (master and dev) as well as ProcessWire 2.8 (master). We also have ProcessWire 2.7 (master and dev) docs but these are not updated since this version of ProcessWire is no longer active. The whole doc-generation process is automated including auto-pushing changes to GitHub. The current cycle is: ProcessWire 2.8.x Master branch docs: updated once at the beginning of every month ProcessWire 3.x Master branch: updated once at the beginning of every month ProcessWire 3.x Dev branch: updated once weekly, every Friday Docs are generated for all .php and .module files under /wire/core/ and /wire/modules/. Currently, this is all done via my home PC. I am on a Windows machine so nothing could really go wrong... . Barring the unforeseen, these docs should be roughly in step with the latest ProcessWire commits. Now running on a remote server. Tools used Windows PowerShell (move over wget! ) wget Git-Bash Windows Task Scheduler (there's your cron right there ) cron Pear APIGEN Scripts: PowerShell, Bash Script, VBS and Batch files A couple of stress balls I hacked together a dark theme for this project, sublime-text default look. The CSS still needs some work, all help appreciated, thanks. If anyone would like to create an alternative theme, we could incorporate a theme switcher. Feeback, thoughts, suggestions (e.g. text in READMe, etc)? Credits to Ryan for writing such well-commented code...otherwise this project would not have been possible. From the READMe