-
Posts
4,314 -
Joined
-
Last visited
-
Days Won
80
Everything posted by diogo
-
prev / next based on previous page's pageArray
diogo replied to formulate's topic in API & Templates
If there isn't any random behaviour involved, you can simply pass the used selector string to $session, and reuse in in another find. Don't worry about reruning the query, but make sure you use limit. -
It's such a small image, I would serve the large version to everyone.
-
http://www.tehplayground.com/#91kqu1Uyz It works, but doesn't make much sense
- 206 replies
-
- 5
-
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
Looks great Joss! I noticed some things you can improve: The mouth appears later than everything else. On the home page, when the first player is open and I click to open the second, the movement doesn't feel natural because it's not obvious that the first player closes before the second opens happening—on a 13" laptop all i see is the site going up and down. I think there isn't the need to close the open player to open the other and would just leave it open, but if you want to close it, try doing it at the same time, it will be smoother. The "eject" buttons is a link and ruins all the experience by sending me to #. There are 3 possible fixes that I can remember: 1. remove the href from the link (faster but dirty) 2. stop the event with jquery by adding "return: false" or "event.preventDefault()" inside the click (ok to do) 3. replace the <a> tag by a <button> tag and correct the styling to match what you have (more work but also more correct) EDIT: ah! also, when I clicked the first "listen now" on my small laptop, I didn't notice that something had changed under the fold. Only after scrolling down I noticed it.
-
If it's a one image problem, give the image a transparent margin in an image editing software.
-
I think it makes sense to keep the direct output, since more advanced developers will most probably start with a blank state anyway.
- 206 replies
-
- 10
-
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
Just don't forget that "0" != 0 and "0" != FALSE because it's a string. A string is always TRUE
-
Ok, it's more clear now. But consider what I said before. I would avoid duplication as much as possible by using the page fieldtype. You can keep those fields in the user template, or move them to new page template, while keeping the User page connected to the new page.
-
The code goes in the template file. I'm still not sure I understand what you want to do, but I get the feeling that there is some confusion going on. What I'm interpreting from your question, you want to copy one of the fields that is in a User page, or even in all Users pages (You mean the default users pages in the system, right?) to a field in another page. You could do that, and as onjegolders showed to you, it's not difficult. But you would create an unnecessary duplication of data. Unnecessary because you can use the original data when needed. To get that data, you only need t know how to access the user page and get the required field. To get the current user (the user that is viewing the website), do as i said before $user->nameOfField. To another specific user use find() or get() with the $users object http://cheatsheet.processwire.com/#users. If you want to create pages that are directly connected to a user, create a page field to refer to that user http://wiki.processwire.com/index.php/Page_Field. Like this you will have access to all the actual info of that user, instead of a copy of the content of one their fields.
-
Thats not how you call the user. Try this: $user->nameOfField
-
http://www.tinyprocesshouse.com/posts/why-processhouse/
-
Great site Nico! I have some some trouble with the scroll inside the content areas (about/contact), but love the rest.
-
Sérgio, you got me curious
-
No one noticed that I forgot to save the field in my code Added it already
-
Hm, not that cool, my free trial will expire in 3 days The demo is here: $.get( "http://rhodium-4zp.lightningpw.com/test/", // <- there, see? sorted, function( data ) { $( "#result" ).html( data ); }); }
-
See the PHP code
-
changing the order of a page field is as easy as pushing the elements one at a time: I prepared an example on codepen using jqueryUI "sortable widget" with the "serialize" option and get http://codepen.io/diogo-ed/pen/fgazd On the pen I followed the instructions from the serialize method and used the ids of the pages after the underscore on the ID "page_123" http://api.jqueryui.com/sortable/#method-serialize The code in PW is really simple: foreach($input->get->page as $g){ //iterate all the page[] array from GET $p = $pages->get($g); // look for the page with this ID echo "<li>".$p->id."</li>"; $page->of(false); // set output formatting of $page->page_field->push($p); // push it to the end of the field $page->save("page_field"); // save page } EDIT: I'm using lightning.pw for the ajax call in the demo EDIT2: Like kongondo says, you need to sanitize the get calls. Take this only as a prof of concept. EDIT3: Added the output formatting of and save the field (forgot before)
-
Allow a user to edit a specific page in the front-end
diogo replied to mscore's topic in General Support
Have you seen Fredi? http://modules.processwire.com/modules/fredi/ -
As adrian said. Don't know if they influence on this but you have some problems with your code: <li><a href="<?php echo $page->url; //echo was missing ?>">Предложение</a></li> <li class="active"><a href="<?php echo $page->url; //echo was missing ?>spros/">Спрос</a></li> if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1 == 'spros') { $selectSpros = TRUE; } else if($input->urlSegment1) { throw new Wire404Exception(); } else { $selectSpros = FALSE; } // I think like this is more readable: if($input->urlSegment1) { if($input->urlSegment2 OR $input->urlSegment1 != 'spros') { throw new Wire404Exception(); } $selectSpros = TRUE; } else { $selectSpros = FALSE; }
-
Textile has support for tables http://txstyle.org/doc/15/tables but copy/pasting from excel is not an option here. Doesn't seem too difficult to create a text formatter for this, since when you copy/paste from excel you get tabular data like this: ewrwer ewe werew werew werewr werwer werwer ewrewr ewrewr werq wqeqe qweqwe
- 3 replies
-
- 1
-
-
- content
- formatting
-
(and 1 more)
Tagged with:
-
Like it was said yes, it can. But if all you want is a simple tumblog have a look at Chyrp http://chyrp.net/ That said, PW can perfectly take care of the task and this is probably how I would approach it in PW: — Create the blog template and page to hold the articles in the tree — Create a template for each type of post (image, text, video, quote, whatever...) with the custom fields needed for each — Limit those templates to have the blog page as parent (this will allow you to have the quick creation of these on the quick button) — On each of these template files create the PHP for the individual post page ex: <?php //quote post if(!count($options['pageStack'])) include('head.inc'); //render the head only if this page is not being rendered inside another page ?> <blockquote> <?=$page->quote?> <footer> — <cite><a href="<?=$page->cite_source?>/"><?=$page->cite?></a></cite> </footer> </blockquote> <?php if(!count($options['pageStack'])) include('head.inc'); // same as with head — and then render them on the blog template: <?php include('head.inc'); foreach($page->children as $post) { echo $post->render(); //render all posts } include('head.inc'); Note: this is minimal code just for example, written directly in the browser and completely untested. See how to paginate results here https://processwire.com/api/modules/markup-pager-nav/ And read about categorisation here https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/
-
By the way, You might want to get yourself an avatar. On your 21st post the forum system will automatically and irreversibly replace the generic image by one of the spice girls (randomly chosen)
-
You didn't sound defensive at all!! Sorry that I started that, I can't repeat anymore that I love the site as it is The comment on the menu comes exactly from that, because the site is so positively minimalistic, and yes, because it has a print feeling (I'm a graphic designer by the way), somehow I felt that the menu brings too much animation to it. It's also natural that André (onjegolders) and I have more or less the same vision on this because we worked together and had long conversations about these kind of details. But, unlike how pwired puts it, this was NOT criticism (constructive or not), but just a friendly and completely subjective remark on a detail on a site that I admire.
-
I'm also using velocity in my site. Very smooth indeed! Consider also having the menu inside the the red bar, like this it would just come down with it and might be more natural. It's a detail, but because it's the strongest element in the site, I think it's worth it to get it right.