-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
A guy at Kodingen is working on this. It's not music, but it's sound and good for programming http://rainycafe.com/ love it!
-
You can read it that way, but in that case all cookies would conform to it. I don't think that was the intention of the legislator.
-
Love the example I forgot this detail and my example would certainly ruin any change...
-
I think it doesn't meet the criterion B because of this part "service explicitly requested by the subscriber or user to provide the service". But it's enough to conform with A, so everything is fine.
-
You should change this: if ($counter == $magicNumber || $product == $lastProduct) to this: if ($counter % $magicNumber == 0 || $product == $lastProduct)
-
You can also redirect the page to the new URL or throw a 404 manualy if accessed directly.
-
to answer your question, it shouldn't be difficult to override this behavior because it all happens wit javascript. I wrote these three lines very quickly in the browser console. It's not good code and not necessarily how you should do it, it's not removing url forbidden characters for instance, but it shows that it's possible to do what you want only by adding javascript to the admin page. edit: With base on Ryan's post under, this code would break important functionality. I will leave it there, but don't use it. function replaceVal(){$('#Inputfield_name').val($("#Inputfield_title").val().replace(/\s/g, "").toLowerCase());} $("#Inputfield_title").keyup(function(){replaceVal()}); $("#submit_save").click(function(){replaceVal()});
-
Like Wanze said, in this case it can be used as a counter. Strangely the same doesn't happen with multiple image fields, where the key returns the name of the image. Ryan, if you are reading this, why is it?
-
I confess I don't understand exactly what will be the benefits of changing the way the admin works, but I may not be visualizing it correctly. As I told you , I would try to achieve the best without changing the admin. If you can get everything to work without "hacking" it will be easier later to think of a good admin solution if needed. But again, maybe I just didn't understand exactly what you want to do. It's good to keep the real page structure of course, but if you think the pages will be too deep in the tree you can organize them in any way you want by using the page field for relating the sections to pages. You can have, for instance, a "reusable sections" page where you organize all reusable sections as children. But if you have a clear idea of what you want to do I may be just confusing things for you. Maybe you can explain in more detail what you want, like elaborating more on the image of the first post, and we can help you with the thinking
-
You could use getItemKey() like this: if($a->getItemKey($i) % 2 != 0) But thinking better, this does the same and it's simpler: foreach ($productList as $key => $product){ if($key % 2 != 0) { // echo } ...
-
I'm on mobile, so i will try to help without code. In your example, inside the foreach, check if the item is even (%=0) and not the last. If true, echo a closing row div and open a new one. For checking this you can use a counter or the api. Look on he cheatsheet for the array methods getItemKey() and last().
-
In international english we do
-
For making a translation: Install the language module (it's on the core, just press the install button) and create a new language. Pick any language pack to serve as the base for your translation and upload it to the "language translation files" field on the newly created language. On each json file that will appear represented on that field there is an "edit" button on the far right, use them to translate all the files. When you are finish translating, take note of the ID of the language page that you created (last number on the url when editing) and look for the folder with that number inside the /site/assets/ folder. Zip that folder with a nice name and release it into the wild! It's easy peasy to convert one of these to pw
-
Fredi is great
-
I guess it's even more brilliant to just let pw do it's work
-
although numChildren is not bulletproof if you start deleting pages... but what are the odds?
-
Hello Guy, It sounds that the repeater is just complicating things here. Everything that you can do with a repeater you can also with a group of normal pages. In your place I would step back and rethink your strategy from there.
-
You could do it, but I can see already lots of problems in your structure, because , if you will have more information related to each drink, how will you do? repeat it in each entry? The best way to solve this in my opinion, is to create a "drinks" page, and start adding all your drinks as children of that page. You can have a template for drinks with the fields for the info. Then you just have to refer to that drink in the blog entry via a pageFieldType instead of a text field. For listing the drinks it also becomes simpler: $drinks = $pages->find("template=drink"); echo "<h2>Drinks:</h2>"; echo "<ul>"; foreach($drinks as $drink){ echo "<li>"; echo $drink->title; echo "</li>"; } echo "</ul>";And then you can do things as finding the articles that referred to one drink: $articles->find("template=article, drink.name=dry-martini"); To output the drink info inside the article is also easy: echo $page->drink->title; Edit: corrected typo.
-
Anyone else wants to step in and explain again the same?
-
it just checks that the field is not empty. If for some reason you don't put anything on that field in some entries, they won't be included on the array, and there won't be any empty <li> on the site. edit: to explain better, doing (drink!=) is the same as doing (drink!=''),. Meaning: drink is not and empty string.
-
Let's say your bog entries have a template called "entry" // finds all pages with template "entry" that have a non-empty "drink" field and sort alphabetically by the "drink" field $entries = $pages->find("template=entry, drink!=, sort=drink"); echo "<h2>Drinks:</h2>"; echo "<ul>"; foreach($entries as $entry){ echo "<li>"; echo $entry->drink; echo "</li>"; } echo "</ul>";
-
Manfred, although I think you are right in some of what you say, I think your tone is wrong and reveals your inexperience. I confess I was a bit irritated with your post because this is not the first time you throw the validator errors at someone in the forum. I agree that it's not difficult to add alt to all images but, although the validator is a useful tool, your brain and judgement are much more needed. Analize the images on Joss's site without your beloved validator and you will understand what I mean. Tell me honestly, is there any image that needs a description? I will answer: no. The first image is the banner, after that you have three images that are there to support the headlines, and finally you have the social buttons that are inside links (in this case the link should have a title, since there's nothing beside the image explaining what it does). I'm not saying that we should ignore the suggestions of the validator, and the recommendation is to add an empty alt to an image if there isn't a description (which Joss didn't). This is not for SEO as you mentioned, but mostly so that screen readers (software for visual impaired people) know they should ignore them. So, here's another important tool to have in your toolbelt http://webanywhere.cs.washington.edu/beta/ I sincerely hope I'm not being too harsh and that you don't take my observation personally.
-
Welcome aren, Can you tell more about your "Drink" field? Where would those values be? How are drinks relating to each other in the admin? If you didn't decide those things yet, tell us what you want to do from the concept so we can give you suggestions on how to accomplish it.
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
diogo replied to ryan's topic in Modules/Plugins
You can use a function to extract the id from the url. This one should work for all the variations in youtube http://webdeveloperswall.com/php/get-youtube-video-id-from-url -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
diogo replied to ryan's topic in Modules/Plugins
You can use the module in a text field also, but because it will look for <p> tags around the video, make sure you also choose textile or markdown before the video formatter on that same field. It works, but it's a lot of unnecessary processing for something that simple. Or you could do this without a module. Just create a video ID field, and embed the video like this echo "<iframe width='560' height='315' src='http://www.youtube.com/embed/{$page->videoID_field}'></iframe>"; If you want to control some aspects of the player add as many of these parameters as you wish to the video url https://developers.google.com/youtube/player_parameters echo "<iframe width='560' height='315' src='http://www.youtube.com/embed/{$page->video_id}?autoplay=1&theme=light'></iframe>"; And if you want, those parameters can be dynamic: echo "<iframe width='560' height='315' src='http://www.youtube.com/embed/{$page->video_id}?autoplay={$page->video_autoplay}&theme={$page->video_theme}'></iframe>";