-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
makes sense, although in a purely semantic logic i would say a page can't be sibling of itself, and for me it would make more sense to write $page->parent->children for that... even if longer.
-
I think that's the right way indeed. But I'm surprised that siblings return also the page itself...
-
Need Community: new Field Tags Module
diogo replied to Adam Kiss's topic in Module/Plugin Development
Adam, I'll be away from the computer for two days, starting in 2 minutes. Feel free to copy what you want from my code, use it on your module, and make the result the official one. When you finish it, feel also free (as administrator) to edit my thread and remove the file -
How to find all normal public pages — only those we'd want in sitemap.xml
diogo replied to alan's topic in General Support
There is a sitemap module http://processwire.com/talk/topic/799-module-xml-sitemap/ Doesn't solve the short-links part, but maybe you can figure also this from there. -
That's ok for me, the developer doesn't need pretty URLs
-
I need to make a change on a template while the pages are still being viewed by people. i created a new test page and a new test template and copied the template file and called it "test.php". on this file i added on top $page = $pages->get("name=original") and on header and footer, where i had things like if($page->template == "original") i had to change them to if($page->template == "original" || $page->template == "test") All works fine, of course, but i was thinking that maybe all this could be made easier with a module. Would be nice if, for instance, the system would recognize a specific URL parameter (site/page/super-secret-test-parameter), and look for the file "test_template.php" instead of "template.php". I don't have any idea of how to make a module like this that's why I'm posting it here.
-
Admin language not working with custom admin theme
diogo replied to Soma's topic in Multi-Language Support
Your English is not bad, it's just a bit glued -
should be the same function so, for now, this would solve: choose one of those files, find the function and wrap it in this conditional if ( !function_exists('__') ) : // the function endif; edit: or maybe you can just include_once, instead of include... i don't know if it would have any side effects.
-
Multi-Language Site for Childrens Technical Learning Center
diogo replied to neildaemond's topic in Showcase
It works well for the audience. i think it just feels a bit more technological than fun... with more work it will go there -
I'm not a big fan of hiding things. maybe they could be accommodated some how... I still like your blog very much! I even subscribed to your feed, even tough I don't know German edit: why not keeping two buttons: menu and suche, and put all your navigation on a vertical dropdown on the menu button? just throwing the first thing that came to my mind...
-
hey, where does the menu go??
-
By the way, I like the typeface used on the site and forums. But the zero... aaarggg
-
I meant YOU and not I! I was talking about onjegolders
-
Thanks for the comments! I uploaded a new version based on those suggestions. Corrected. I'm glad PHP doesn't punish bad English yet I want to add this feature on a future version, but I don't want to implement it directly on the tags because it should be the designer, not the editor, to have control over it. Maybe adding it to preferences of the module would be the way to go. I don't think it would be possible to make it on a per field basis... Done, thanks! I implemented this but, at least for now, instead of {images} it will use index zero {images:0} to output them all. There are several reasons for this: It was faster to implement; it uses only one preg_match instead of two; and it prevents accidental use of tags by the editor — it's more unlikely that someone will type {images:0} on a text than {images}. Done!
-
I think there isn't any favicon on the default install... how does it look like?
-
This is my first module, and you can see how it started on this conversation http://processwire.c...0302#entry10302 It allows you to add images from an image field to any place of a text area by inserting this tag {fieldname:n}, where "fieldname" is the name of the image field, and "n" is the position of the image in this field. It will output markup on this format: <img src='$image->url' alt='$image->description'> To activate it on a text area field, go to the DETAILS tab on this field EDIT page, and choose it from the Text Formatters options. edit: on version 1.1 you can output all the images from one field at once by giving a 0(zero) index: {fieldname:0} IMPORTANT!: At the same time as I built this module, adamkiss started building a more robust module with the same functionality http://processwire.c...ld-tags-module/. We decided to merge efforts on his module so, possibly I won't work on updating this one anymore. I'll keep the download file in this thread for reference though. EDIT: created a GIT repo for this module. For downloading the module, head to: https://github.com/ocorreiododiogo/PW-ImageTags
-
I must have You must have broken some record by becoming a "Full Member" in 4 days
-
Thanks Ryan, I will apply that
-
You have to create a new editor role and assign it to this user (maybe you did this already). Then go to the template, and in "Access" do as on the attached screenshot edit: sorry, i completely misunderstood your question...
-
Simplest explanation is this: $x = 1 // <-- this one assigns a value 1 == '1' // --> true 1 === '1' // --> false 1 === 1 // --> true 1 ======== '1' // <-- This one I don't know, will look for it on my books
-
It didn't take long here is an alpha version of the module. I will open a new thread for it as soon as you guys tell me that it's well built. For now it uses the format {img:n}, but would be nice to have this as a module option. edit: I used the Textile formatter module as a working base. ------------------------------ edit2: Updated the module to version 0.2 The first version was assuming that the image field was called "images". This new version takes the first part of the provided tag between the opening bracket and the colon, checks if there is any field with the same name, and uses that field to look for the image in the provided position. This way, you can have different image fields feeding the same text area. So, now the format to use for tags is {ImageFieldName:22} Besides checking for the existence of the field, I also want to check if it is a "Image" fieldType, but this code is not working for me: if($this->page->$field->type == "Image") edit3: I opened a new thread for this module. It can be downloaded from there: http://processwire.c...ule-image-tags/
-
That would be great! Don't forget to make it work for textile besides markdown
-
Maybe this would be a good opportunity to get my hands dirty with module making
-
Welcome back!