-
Posts
111 -
Joined
-
Last visited
Posts posted by k07n
-
-
Hi! Great module, thanks for it.
I think it can help me to keep catalog up to date. But I need to generate page name from another field than Title (Many titles are similar, but "article number" field is unique). Is it possible somehow?
-
Yo Willy,
Can you also write a book how to grow and style a beard like yours?
Here you are: https://youtu.be/5djCKMi4sIE?t=25s
- 3
-
Found little typo in main.js
Here is the pull-request https://github.com/somatonic/ProcessWireCheatsheet/pull/1
- 2
-
Am thinking again at what Diogo said. Maybe an issue with creating your own users rather than using the default ones would be you would lose all the valuable session stuff?
Can you tell us your case and what exactly you want from users? Maybe someone will give an advice how to organise this?
-
Hi!
Dumb question again here (%
I have pages with different count of images.
How can I output images with limit=3 for example?
-
Hi apeisa, thanks for such a quick reply!
So I don't have to include the templates "articles.php", "images.php" and so on.. in the code?
Oh, and can you please tell me what the "render" in the code does?
Each type of articles must have it's own template. "Render" makes output depending on different templates.
-
After saving the page with template "custom_user" - new user will be created with name==page name.
I don't test it. And I wonder what I'm doing at all in the conversation of people with 700+ posts =))
... public function createTheUser($event) { if($this->page->template == 'custom_user'){ $newusername = $this->page->name; $newuser = $users->add($newusername); $newuser->pass = 'some password'; $newuser->save(); } } ...
- 1
-
Thanks Diogo, I tried creating $u = new user(); and soforth but didn't seem to work. I'll have to have another dig around though I can't seem to find an example of creating a new user/page within a module.
$users->add("name")
Add new User with the given name and return it. http://processwire.com/api/cheatsheet/?filter=users
But maybe i've misunderstood the problem.
- 1
-
edit: that is the same as this (entering and leaving php to write html):
Hi, diogo. Which method is better to use? "Echoing" or "html outside php"?
-
I'll ask here, think my question is similar.
I want to add ID to pages's name in 1 template (exactly like on this forum "/3276-change-auto-bla-bla-etc/").
So I need to write a module with hooks for this or what? Please, push me to the right direction.
upd:
made it this way:
<?php class PrefixToPagename extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Add prefix (id) to the page name', 'version' => 100, 'summary' => 'Add prefix (id) to the page name', 'href' => '', 'singular' => true, 'autoload' => true, ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook before the $pages->save, to add prefix if needed $this->pages->addHookBefore('save', $this, 'addPrefix'); } /** * Hooks into the pages->save method and sorts pages with a certain template based on certain criteria * */ public function addPrefix($event) { $page = $event->arguments[0]; // Only run if the page we just saved has the "vacancy" template if ($page->template == 'vacancy') { $oldname = explode ('-', $page->name); if ($oldname[0] != $page->id){ $page->name = $page->id . '-' . $page->name; } } } }
thanks guys from this thread.
- 1
-
Hi.
Can you explain what this thing does:
$page->body .= <<< _OUT .... _OUT
And where can I read more about "<<<"?
-
Hover works too, but most of the time I'm fighting with the mouse to get a tooltip
/wire/modules/Process/ProcessPageList/ProcessPageList.js
function listChild(child) { //bla-bla-bla .attr('title', child.path) //bla-bla-bla
change to something like:
.attr('title', child.path + ' id' + child.id)
it will show ID on tooltip.
And the question =)
How made this not by hacking "core"?
-
I have played with selectors a little.
My task is solved by
$options = array('selector' => 'id|parent=1006|1003');
1006 and 1003 - ids of "Want in menu 1|2" in my structure.
So we can use multiple "parents" =)
- 1
-
You can' specify multiple roots, but you can exclude children.
Thank you, Soma!
I'll try to exclude pages by template.
-
Hi!
Read all thread, but can't solve my problem.
My structure:
Home
-- About
-- Something Else
-- Want it in menu1
----Subpage11
----Subpage12
---- ..more of them..
-- Want it in menu2
----Subpage21
----Subpage22
---- ..more of them2..
What is the easiest way to render only "Want it in menu 1|2" and their children?
I think of excluding all others pages, but pages can grow. How can I just point only 2 of pages to render?
Sorry for my English. Hope you understand what I mean.
upd:
If only be that you can specify multiple parents.
-
Hi!
Ctrl+S saves the page but also opens the browser's "save dialog".
Is it normal, just as ctrl+f4 and other standard shortcuts, or am I doing something wrong?
Actually Ctrl+S is one of several of the little MODX features that I'm miss so much.upd: w7, chrome, FF. PW 2.3 -
Or look in the status bar while hovering a page edit link, this can be quicker
diogo - resident forum ninja - strikes, once again
hint: if you know the answer, just click "Post" and then edit post
- 2
-
Dumb question here:Where can I find ID of the page in the backend?
-
it's.. it's.. beautiful
-
There are some good tutorials on pw wiki.
You can start from here:
http://wiki.processwire.com/index.php/Small_Project_Walkthrough
http://wiki.processwire.com/index.php/Basic_Website_Tutorial
They really helped me to understand how everything works.
-
Great thread. Must be the start point for newbies.
- 2
-
Hi!
"Caret" added to 1st level menu if it has a submenu.
https://github.com/jsanglier/Bootwire-Starter-Profile/pull/1
Hope this will be usefull to someone.
- 1
-
You might also want to copy htaccess.txt to .htaccess in the ProcessWire top-level directory.
What is it for? Just for installer?
-
Thanks for the reply!
I can share rewriting and php-fpm configuration also if required.
I think it will be very useful.
Cheatsheet E-Book for offline use
in Getting Started
Posted