-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Get data from a latin-1 encoded DB and insert it into PW
Soma replied to thomas's topic in API & Templates
It does character replacements which you have/can defined in the Inputfield Page Name module settings. -
forgot backend password, how do you reset?!
Soma replied to danielholanda's topic in Getting Started
There's a Password Forgot module but not installed by default. I think only solution would be to install new, or do this: Create a /tool.php in the same directory as the /index.php in the root of PW install. Paste in this code: <?php include("index.php"); wire("modules")->get("ProcessForgotPassword"); Save it and if necessary upload it to your server. Remember the file as you'll need it shortly. Now call it from the browser http://yourdomain.com/tool.php and the Module will get installed and a Password forgot link should show up on the login screen. Delete the tool.php. Edit: You can, using this technique, also set a new password for the admin, see on the link Diogo posted.- 18 replies
-
Glad it works out for you thomas! Feel free to adapt it to your needs, it's not an official module just a little helper.
-
Have a look here: http://processwire.c...hout-using-gui/ Or on modules like shop by apeisa there's lots examples.
-
What don't you understand? I thought you understand code more than words? I can't explain more without repeating what I already wrote. It does search for pages that have the same tags selected, counts the tags matching and adds that to the score property and sorts by score AND modified, so the most recent are first. $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); $page = current page or another one (to exlude it from the search) $tags = a PageArray of tags $field = the Page field which holds the tags, to know which field to search optional: $tmpl = the template of the pages to search in. Multiple templates like "t1|t2|t3" $limit = how many to search It returns a PageArray which can be used further, if none found it returns null.
-
Since this thread is related , I'm also posting this here. I wrote a little helper module to find related pages with score and sorting by score AND modified. Module code can be found here: https://gist.github.com/3558974 $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); It add a $pages->findRelated() method. You can do something like this: $found = $pages->findRelated($page, $page->tags, 'tags', 'product|product2', 100); if($found) { foreach( $found->slice(0,5) as $rel ) { echo "<p><a href='$rel->url'>$rel->title</a> ($rel->score)</p>"; } } else { echo "<p>No related Products found</p>"; }
-
I also thought about this Pete but it doesn't sort by multiple. It sorts first all by id and then all by title. Well since I'm also in need of such exact feature for my project, I took this approach and created a little helper module. After install you have a new method on $pages var. $pages->findRelated(...); $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); I tried also to do it with the PW API only but it isn't possible to sort by score AND modified so I commented that part out and wrote a plain sql query to do it instead. To use it you do something like this: $found = $pages->findRelated($page, $page->tags, 'tags', 'product|product2', 50); if($found) { foreach( $found as $rel ) { echo "<p><a href='$rel->url'>$rel->title</a> ($rel->score)</p>"; } } else { echo "<p>No related Products found</p>"; } The module can be found here: https://gist.github.com/3558974
-
Great Ryan! Question. What is the intended way to update a language pack's files? Drag them into clearly doesn't. Just upload them to the ftp folder? Another thing that comes to thought, would it be to be possible to present core/system translation separate (just visually, tabs ...)? Not sure if that would help. Or maybe just filter them by /wire/ and /site/. I like the way translation is an open and flexible system, just think any even so little assistance in maintaining it will be greatly appreciated. Thanks Ryan.
-
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
Ryan, I'm still wondering how this can be? I think it's not intended behaviour!? The string for "Templates" was put in /site/templates-admin/default.php as commented out, same as you did in default admin theme. So the topnav.inc include then can use it. *__("Templates") Then I translated it through translater in the file for the default.php /site/templates-admin/default.php And then "setup/templates" admin page got the title from the translation even though the page title is a language field and empty in german title instance. Later I removed the string from the default.php but the translation remained even though it's abandoned and the string in template is removed. How does this come together? -
Getting template name from a text field for form builder
Soma replied to thetuningspoon's topic in General Support
Is the field a text field or textarea? maybe try: echo $templates->get(trim(strip_tags($page->form_name))); -
So ... any news on this? Again, it doesn't show any changes made when I use the preview button. Only when I open the preview a second time it shows the changes. I don't know what the problem is but it was always like this and doesn't let me use this module. I use OSX and Chrome and in FF it's the same.
-
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
So much for the "Easy to translate even for editors"! Bahhh -
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
I give up. Now I removed the title and all translation for the "Templates" and it still shows "Vorlagen" as the title when I go to Setup->Templates. The translation in ProcessTemplates for module Title is empty. So is the page title for german for both "Templates" pages. DB has no occurence of the word "Vorlagen" and I also emptied cache, but still it remains there magically. Edit: NO really. I found it out. It looks it's something with my teflon theme. When switch to default admin theme the Title shows "Templates" as it should. BUT when I searched for the word in the theme there's no presents of "Vorlagen", so I found out that the translation of the file /site/templates-admin/default.php had abandoned translations still in there (from testing with adding them in the default.php) from which it took the title even when I deleted them in default.php. Now deleting them from in the translation abandoned ones, it's finally gone! -
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
Ryan, I noticed something strange. As I translated the Admin pages through the language title, for example "Templates" I had "Vorlagen" in the german title. But when I remove it and make the title field blank it still shows "Vorlagen" instead of default english "Templates". Not sure where this coming from, because there's no such translation present, nor from the ProcessModule translation nor from any other source. It is the page title of admin "Templates" simply. I double checked and put and removed the translations, but it remains, even if I rename it to "blabla" for german and remove it again it again show "Vorlagen". So after trying I looked into DB and the title "Vorlagen" is still there saved in the page_title field. Sounds like a bug. Edit: I looked at it again and looked at the page ids. I just noticed it's somehow messing up and taking the default site's "Templates" (1003) page title for the admin "Templates" (11). So I'm a little speechless -
I think I've heard another one too, is that possible? Must be really hard to hit two birds with one stone though.
-
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
I just tested commited an update to the teflon theme, so the submenus get title from module info. If module is translateable it will work show the language title if it's translated already, otherwise you have to create a translation. If the module is not translateable you can't. -
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
That makes sense for the submenus. So the only thing would be if I want to rename it to something different using the page title I can't. I just took your approach from the default admin theme for the main topmenu item that got defined in the default.php comment. -
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
Would that also translate the navigation title? That would make 3 ways to make the same translateable. - through module - through admin theme default.php - through direct admin page title (if page title is changed to multi-language text field) It is also to consider that we discussed and decided that not every word and module will be translated which doesn't belong to normal editors. Lot's of modules core/third-party aren't translateable (yet) and adding modules (that will maybe also create admin pages) will have to be translated if you want to by the developer himself, unless the module developer serves his modules with translation files for every language, which will not happen anyway except the community cares to help to do so. -
Admin language not working with custom admin theme
Soma replied to Soma's topic in Multi-Language Support
I think for those menu subentries it would be easier to include them in the theme default.php, same like the top menu entries. So they can be translated from the same translation file for default.php. /* * Dynamic phrases that we want to be automatically translated * * These are in a comment so that they register with the parser, in place of the dynamic __() function calls with page titles. * * __("Pages"); * __("Setup"); * __("Modules"); * __("Access"); * __("Admin"); * Standard Submenus * __("Fields"); * __("Templates"); * __("Languages"); * __("Users"); * __("Roles"); * __("Permissions"); * */ -
Duplicate pages_ids in a field_ DB table. Possible bug?
Soma replied to buddy's topic in General Support
I love selfsupport. -
If you ask me... Textmate: Right click ->Convert ->Tabs to Spaces
-
Just saw this note of yours. When I have code I copy from editor I first switch tabs to spaces. In Sublime2 I can do this with one click in status bar.
-
The key is: "title client.title" HF
-
Selector for the value of a dropdown built with a PageArray
Soma replied to buddy's topic in API & Templates
Hey Buddy I would be insterested what the "usual" way is? Decodesiffering your post... I think you can simply first query the color pages. It will give you a PageArray with the color pages, with that you can then use directly to find the pages with these colors selected through a page field. // get all pages with at least 1 of these colors, this will return a page array, if you echo it you'll get a list of IDs // here "color" is the text field with the color string $pagesForColor = $pages->find('color=0x00f|0x0f0|0xf00'); // we find all pages that have at least one of the colors selected // here "color_select" would be the page field $result = $pages->find("parent=/boxes/, color_select=$pagesForColor"); It's that what you're looking for? PS: Don't use $page or $pages variables for the results of queries. YOu may overwrite the template system variable with that name. -
I would also go for a structured page tree and see the page tree as the main repeater. Edit: need some sleep.. so also what I wanted to add you could keep the structure ...->book(page)->runtime(repaeter-range). So if the level of information becomes 1 dimensional use a repeater there i.e. runtime has a repater for range. Book1 ->Runtime1 ->Runtime2 - range1 - range2 Book2 ... Also depends a lot on how you want to be able deal with these data. Maybe some thought about what you want to be able to do with it later i.e. if storing data in json format or comma separated strings, you'll have hard time to filter content based on that. Using a page structure will, at the best, let you use simple PW selector queries to filter or search the data.