-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
Here is a screencast to show this functionality for those who arre curious but can't or don't want to test: This is my first screencast ever
-
I will have to investigate more, but it may take some time to make something cross browser. Although they say it's outdated, this is not very motivating http://support.mozilla.org/en-US/kb/Granting%20JavaScript%20access%20to%20the%20clipboard
-
Your username and pass to enter the admin are not in the config file. Those that you have in the config file are for the database. You can reset your password like this http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/
-
@roderigo, welcome back! When can we see that "after hours" photo of Maryla?
-
Glad you like it Ryan! Browser support is sparse. The code I use works only on chrome but I think there are ways of making it work in firefox (not sure, though). As it is, if you try to paste an image in firefox it only pastes to the editable text. I would be happy if this would go in the core, but it still needs some work. I'm using that span just for testing (ya, also the yellow is just for testing), the definitive solution will be having a hidden input that gets focused by pressing another element. Maybe a button or area, I'm open to suggestions... Personally, I wouldn't make it configurable. The code still needs some work of course. I'm not checking if the browser supports these method before activating the functionality, but it will have to be.
-
Here is a solution https://gist.github.com/ncr/399624 And a fiddle for testing http://jsfiddle.net/mBYPD/
-
Thanks Marc! I didn't think you haven't seen the site here... I would have called your attention somehow
-
Seems like a good approach to me. You should use $page->name for the IDs instead of $page->title, because it will strip the spaces and any character that is not allowed on IDs. Maybe this is even the reason why your jQuery scrolling is broken. Doesn't seem bad to me, but you may prefer repeaters for this.
- 13 replies
-
- 1
-
- single page
- one page
-
(and 3 more)
Tagged with:
-
I managed to make this work For testing purposes, I'm using the drag and drop files in here span as a placeholder to paste the image from the clipboard and I marked it with a yellow background to make it obvious (I know it doesn't make sense, but it's just for testing). To paste the file just click on that span and ctrl+v or right click on it and paste from the context menu. It's late and I want to sleep, so no more explanations for today. But if you want to test all you need is to replace the inputfieldFile.js inside the inputfieldFile module folder by the file attached in this post. BE WARNED: THIS IS HIGHLY EXPERIMENTAL (but I think it won't blow your server) edit: I can't upload a .js file. Just change from .txt to .js or paste the contents edit2: made some corrections with a fresh mind, after sleeping edit3: changed some details on the code. The file is new InputfieldFile.txt
-
Try opening the permissons on the /site/modules/ and /site/assets/ directories. http://modules.processwire.com/modules/modules-manager/
-
Long shot, but did you delete the cach, logs or sessions folders before moving the site? http://processwire.com/talk/topic/2786-request-seems-to-be-forged/?p=30109
-
Would be nice to be able to upload images from the clipboard. I investigated a bit how the image field could be extended with this and found some useful information here http://www.smartjava.org/content/copy-and-paste-images-your-browser-using-w3c-clipboard-api Turns out that we couldn't just catch a ctl+v command like in that example, because we have text area and other image fields where we might be pasting on the same page. The solution could be to create a hidden (opacity:0) element somewhere in the uploads box with the attribute "ContentEditable" (I tried, for intance, over the "drag and drop files in here" span) so we can use the paste entry in the context menu. Here is an example of how it can work https://github.com/JoelBesada/pasteboard/blob/master/assets/js/modules/copyandpaste.coffee from the source code of http://pasteboard.co/ You people think this might be usefull? Is it doable? edit: see the next post
-
Thanks for your nice words totoff!
-
You don't need to install jQuery in pw, you use it as any other script. Drop the file in the scripts folder and link to it from the html head. (The default install already comes with the file jquery-1.4.2.min.js, but you might want to download another version). Or simply link to a jQuey CDN on the web (http://code.jquery.com/ or https://developers.google.com/speed/libraries/devguide#jquery). Anyway, by using Mathew's solution, you have to be aware that you will have to list all the rows from the table, and hide them with javascript to paginate (I see that it also does server side, but didn't went deep on investigating). This means that processwire will have to pull all the results, wish might be a waste of memory. Best solution would be to render the table with a limited amount of results depending on the user choice. For this you will need the pagination module http://processwire.com/api/modules/markup-pager-nav/
-
<?=$page->prev->id ? 'previous' : 'first'?> means: if there is a page before this (this isn't the first), the class is "previous", if there isn't, the class is "first". But I don't know what you want to do exactly. You have to adjust to your intention. You could also simply not print the link at all for the first page: if($page->prev->id) { echo "<li><a class='previous' href='{$page->prev->path}'>prev</a></li>"; }
-
edit: to test if a page is a NullPage, we can check if the "id" property exists on that object. If it doesn't have, it is indeed a NullPage. http://processwire.com/api/types/nullpage/ if($page->prev->id){ echo "this isn't the first page" } same thing happens with $page->next So: <nav> <ul id="pages"> <li><a class="<?=$page->prev->id ? 'previous' : 'first'?>" href="<?php echo $page->prev->path; ?>">prev</a></li> <li><a class="<?=$page->next->id ? 'next' : 'last'?>" href="<?php echo $page->next->path; ?>">next</a></li> </ul> </nav> ps: written in the browser and not tested Edit: reread the cheatsheet text, and it says "NullPage", and not nule or false. So we can't test it like I did above. What we have to do is to test if the page has id. I will rewrite the code above.
-
Well, it's only a two letters difference I get called Diego a lot by foreigners. I'm glad there isn't one in the forum...
-
Mark, I think the source of your confusion here is that you still don't understand how PHP works. Unlike other programming languages, PHP can integrate with HTML in two ways: by integrating it, or by being integrated inside it (ok, strange sentence, but I hope it delivers the point). these two do the same thing: <?php echo "<h2>" . $page->title . "</h2>"; ?> <h2><?php echo $page->title; ?><h2> The difference is that, in the first code you are telling PHP to output all the content, while in the second example, you are using it to output only the dynamic content between static content. The important thing to understand (and this was your mistake), is that you start the file outside PHP, and then you can enter it with "<?php" and leave it with "?>". You can never open a PHP tag, when you are already inside another, like here: <?php <-- we opened PHP include("./TUT_header.inc"); echo "<h2>" . $page->title . "</h2>"; <?php echo $page->body; ?> <-- and we opened it again without having closed it before You should read an introduction to PHP to learn all these concepts, and you will see that PW will be much easier then.
-
Very nice Marc! I like how the content is organized, looks like it's very flexible.
-
In PW the best way is to think of each repetition of data as an individual page. The best approach in your case would be to create a page "table" and have the rows as children pages of that one. those pages would have their own template "row" (names are just as example) wish would hold all the fields that correspond to your columns. Everytime you want a new row on the table you just have to create a new page as child of the "table" page. To convert these pages to table rows in the frontend is as easy as this: foreach($pages->get("/table/")->children as $row){ echo "<tr><td>{$row->field1}</td><td>{$row->field2}</td><td>{$row->field3}</td><td>{$row->field4}</td></tr>"; } This is only one part of the answer, but I have to go now... hope it gives you some light.
-
Mark, I don't know where you are having trouble, but PW is really easy to grasp. I can tell you that my first step was to print all the docs from the API and read them in one of my favorite places (on a coffee table by the river looking at the ducks). Once you understand the API everything will seem possible to achieve
-
Oops... sorry Alan.
-
Adam Alan, my ST2 suggests text-decoration out of the box.