-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
Excellent. So, back to clueless, how exactly can we help? Which one to choose over the other? Which one is easier to use? Pros and Cons?
-
It would be good to reference here those different discussions and modules. Otherwise we might end up just repeating ourselves (talking about those different discussions).
-
$page->getArray() and field type Page references
kongondo replied to Mackski's topic in API & Templates
In ProcessWire 3.x (I think only 3?) you can use implode like so: $pageIDsString = $yourPageArray->implode('|', 'id'); //echo $pageIDsString;// returns 1234|2345|8976 etc.. You can choose your delimiter and the property to implode by. There's other interesting methods here. -
Hi @Nukro, Hmm, the default setting is to skip duplicate media. So, if media is being replaced the user must have set it so in the settings. A warning popup would just be an extra, to affirm what they've already set. I am not sure it will be easy/practical to implement since uploading is done via Ajax. I'll have a think. [Edit: should be easy enough as a checkbox to confirm before hitting upload ] By the way, I was not able to finish my write-up as promised in a previous post. I am determined to do this by the end of this week. Thanks for being patient with me.
-
That's the normal behaviour (guest is created user for pages created via API). Edit: Changing created user via API requires one more step. Have a look here onwards:
-
add a sql query to a pages->find() operation?
kongondo replied to bernhard's topic in General Support
There is actually, but can't remember the number Edit (not sure if still current; yep, still 500): -
Thanks for the info Mike. I've moved this to dev talk since the security issue pertains to a third-party software rather than ProcessWire itself.
-
Cool idea . Yes; please file a feature request, thanks. No need for a hook. We can simply pass an option [which I'll create] to render(). However, this will not be as straightforward as it looks. What if that unlistable menu item has children, especially ones that are custom menus? We can't leave them parentless. They will have to be removed. Such a potential situation won't always be apparent at the editing stage; editors could unknowingly create a hierarchy that will break if the option to not list menu items is applied. Please file a request and I'll have a think.
-
Quick response lest I accidentally delete my post again! There's two methods to access MM media (when pagefileSecure is off): 1. Indirect access; via its FieldtypeMediaManager API: $media = $page->your_media_manager_field; Returns a MediaManagerArray object. This will work regardless of the 'guest' setting in an MM template 2. Direct access: using normal PW API to reference the MM pages by their templates : $pages->find("template=media-manager-image, limit=10"); This will not work for guests unless access is granted in the template 'media-manager-image' Keeping this short since I will be writing about this later tonight in MM's docs.
-
A quick btw, in ProcessWire, by default, no users except for logged-in Superusers can view unpublished pages.
-
I somehow managed to delete the original post here when editing it . Rather than rewrite it here, and since it was to feed into a write-up in the Media Manage docs, I might as well write it there. So, that's what I'll do. I'll find some time today and write that, er, write-up. I'll post a link here afterwards...
-
Isn't that exactly what $config->pagefileSecure is meant to do? According to the blog post you reference, it says the 'guest' role will not be able to directly access those files. In addition, I see this from the docs: $config->pagefileSecure bool When used, files in /site/assets/files/ will be protected with the same access as the page. Routines files through a passthrough script. Protection will match the same access as the page. I probably don't get your use case but it seems you want to have your cake and eat it too . Do you want to secure your Media Manager media from guests? If yes, then the config setting is doing its job. MM files are secured from the public (guests). I am guessing though that you want certain users with certain roles to still have access, no? In that case all you have to do is create a role, say 'view-mm-files' and add it to user(s) you want to have access to the files in the frontend. Then, head over to the respective MM media templates i.e. (media-manager-audio, media-manager-document, media-manager-image and media-manager-video) and under their Access Tab under 'What roles can access pages using this template (and those inheriting from it)?', under the column 'View Pages' check the box for 'view-mm-files (see screen below)'. That's it. No hook needed . Those users (when logged in, of course) should be able to view protected files. For the backend (i.e. use/view Media Manager) we already have the permission 'media-manager'. Just add that to the role you've created for your users, e.g. the 'view-mm-files' (as well as going through the above process of giving that role view access in the respective templates )and they should be able to both access Media Manager and see the media.
-
@Jozsef There is no need to ask the same question twice. You already asked this same question in Fredi's support forum here: I'm moving your post there. One, because Fredi has its own support forum and two, multi-threading is not allowed.
-
Happy to announce Blog 2.4.1 is now available for testing on the dev branch. Please test and let me know that it works OK, all the way from install to uninstall and everything in between, thanks. This version is highly refactored, brings in a new cleaner UI (at least I think so), including better sorting of posts/categories/tags, author bios, category description (not sure many know that categories have a field for entering descriptions), etc and one new (frontend) option that enables the control of the 'edit' link that appears for logged in users when viewing a Blog Post. The link can now be placed at the top, bottom or switched off altogether (@thanks to antoiba86 idea). Here are a couple of screens. I have tested in 2.7.2, 2.8.35 and 3.0.42 and everything seems to work fine. However, further tests are needed before I commit this to master. That's where you come in, thanks.
-
Difficult to tell at this point. Could you confirm that the post (meaning the textarea, etc, inputs) are actually sent? JS errors? If it works on your local server but not the live one...that tells us there is some configuration in the live server affecting things. Other than these, I could have look if you are able to grant me temporary access. Welcome to the forums and ProcessWire @al-ex23. I am not sure whether that's a file-compiler related problem. Does refreshing several times help?
-
Thanks for your suggestion @panx and welcome to the forums . I would like to point out that this is now part of the core since a couple of versions back so the module is no longer necessary for newer installs.
-
Which module is this?
-
@cosmicsafari. Welcome to the forums and ProcessWire. You will need to include your Foo.php file in your module ( MyModule.module). ProcessWire doesn't know about it and will not include it for you. You can require it outside the class or in its __construct() or function init() methods (I think either of the three should work). $dir = dirname(__FILE__); require_once($dir . "/Foo.php"); Maybe it was just a typo, but module files end in .module (that's the extension, not .php)
-
Preview of new Blog Dashboard UI coming in the next update... Posts List Quick Post (now in modal) Thoughts? Opposition ?
-
Maybe this is the issue?
-
Is that a "Yes, problem solved!" or a "Yes, I've ticked all the boxes but it still doesn't work!" ?
-
The method rendering those side menus is renderNav(). It takes as a second parameter an array or PageArray. In blog.post (the template file for a single post, which you wish to edit), around lines 20 - 22, you can see it takes the PageArray made up of the current post's categories (blog_categories) as follows: if(count($page->blog_categories)) $subNav .= $blog->renderNav(__('Related Categories'), $page->blog_categories); In the main blog page, i.e. the one that uses the template blog.php, around lines 14 - 15, we see the same function taking a different PageArray; one that is made up of ALL the categories as follows: $categories = $pages->get('template=blog-categories');// this grabs the parent of all category pages $subNav = $blog->renderNav($categories->title, $categories->children);// we pass its children, a PageArray made up of all categories So, the latter code (the lines 14 - 15 in blog.php) is what you need to copy to your blog-post.php to achieve your desired result. Please note that in that demo code, there is no limit set to the number of categories that are returned. If you have lot's of categories you will want to place a limit on the children, e.g. $categories->children('limit=50');
-
There is (ahem..) a commercial module for this kind of thing. It's called Media Manager (Disclosure: I am its author ) By the way, I don't think your post matches the content of this thread. It would be best if you started a different topic. We would then transfer your post and its responses to your new thread. Alternatively, if you can suggest a title for your new thread, we can hive off these posts into that new topic directly.
-
That's the expected behaviour. When you click on a category, you are taken to its page and are shown a list of all the posts that use that category, i.e. /category/my-category/. I can't remember how you set up, but if your "news" is a category, clicking on a post categorised under "news" should take you to /category/news/ with a list of all posts classified as news items. Seems something changed in your system? Some autoload module that is affecting save? I have tested and it works fine here. Does the same thing happen if you edit the post page normally? (i.e. not in the Dashboard modal).
-
@Standard Forge, Glad you find the module useful . As you point out, that's a bad idea . For complex or custom menus, there's a better way to achieve the result you want. I decided not to add any more features such as these to MenuBuilder (including "Bootstrap does this or that"...sort of requests). Instead, since a while back, Menu Builder now provides an API that will return your menu items allowing you greater control over their output. This is done via the method getMenuItems(). Please find detailed examples in this post. Grab one and edit it to suit your needs. Let us know how you get along.