-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
Multiple lists and loops into dynamic reusable piece of code
diogo replied to arjen's topic in General Support
I don't know how to help you here. But somehow, this should work more or less the same way as pagination does. I wonder if looking into that the module we could find something... EDIT: Ok, this as nothing to do with what i said above. I wrote this code on the browser, and didn't test it. So, take it as a proof of concept. EDIT2: I simplified the code, since the only difference you want is in the class EDIT3: corrected some more code $rows = 4; $totalCount = count($jurisdictionsPageChildren); $rowCount = $totalCount / $rows; $firstInRow = 0; $i = 1; while ($i <= $rows){ $mainContent .= "<div class='columns six"; if($i == 1) $mainContent .= " alpha"; if($i == $rows) $mainContent .= " omega"; $mainContent .= "'>"; $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount); $firstInRow+=$rowCount; foreach($sliced as $p){ $mainContent .= "<h2><a$class href='{$p->url}' title='{$p->title}'>{$p->title}</a></h2>"; } $mainContent .= "</div>"; $i++; } EDIT4: Tested the code above and it's working I had to round up the $roundCount because i wasn't getting the last row with less pages. I used ceil() for that. So, final code would be: $rows = 4; $totalCount = count($jurisdictionsPageChildren); $rowCount = ceil($totalCount / $rows); // <- this is what changed $firstInRow = 0; $i = 1; while ($i <= $rows){ $mainContent .= "<div class='columns six"; if($i == 1) $mainContent .= " alpha"; if($i == $rows) $mainContent .= " omega"; $mainContent .= "'>"; $sliced = $jurisdictionsPageChildren->slice($firstInRow, $rowCount); $firstInRow+=$rowCount; foreach($sliced as $p){ $mainContent .= "<h2><a$class href='{$p->url}' title='{$p->title}'>{$p->title}</a></h2>"; } $mainContent .= "</div>"; $i++; } -
"pages" it's a convenient way of calling well, pages, since they are associated with URLs. But it's best if you forget the word "pages" when developing because it leads you to think of visible website pages, when they really are pieces of content that you can use the ways it suits you better.
-
Congratulations for your first project Not my favorite kind of design because it feels a bit template like. Other than that, it works well and it's well structured. One thing I stumped on: when you go to "Serviços", you have a message "em actualização" that makes people think that there isn't yet any content there, when in reality there is if you press on the links...
-
Hm... can we remove this from showcase? Maybe it doesn't make sense to be there anymore. Arjen, 5 seconds is enough for me
-
It's here http://processwire.c...tsfiles-folder/
-
i googled for "worst sites" in portuguese, and there was a guy saing that the worst site in the world is portuguese and linking to it
-
oh... april fools is over and no one commented on my little joke
-
I need help, of course Just let me know if you would do something different, although I'm thinking of updating everything with the ideas that may come from here http://processwire.com/talk/topic/1132-translating-technical-terms/
-
I was late at night finishing a new website. It's for a Portuguese poet/painter/musician that is not very known. The website uses some Flash, but PW is still taking care of some stuff. Any suggestions are welcome, since I didn't have lots of time to make this one. Hope you guys like it http://www.joaovidei...osartes.web.pt/
-
Love it! Both the website and the objects
-
Videos inside processwire: How to embed videos inside processwire?
diogo replied to jester.vergara's topic in FAQs
One more option for this: http://starfishmod.github.com/jquery-oembed-all/ -
yaaaay, i gave the like nr 100 for Ryan enjoy the vacation!
-
Here in Portugal everyone would also understand email. My problem is with words like templates for instance. In Portuguese the correct translation for template is "modelo", but then you will have to use "$template" with the API, and put the files in a folder named "template". Since we are translating also the parts that are also for the developer, we should think of those things. Ryan's solution sounds good. I'm ok with putting the English word in parenthesis, whenever it makes sense. EDIT: Ryan, one sugestion -- On the translation files, the translations that are equal to the English phrase are being cleared. This is a bit annoying because I always get "blank" alerts on the list of files.
-
I'm opening this topic so people can discuss translations. I was thinking of opening one only for Portuguese, but some doubts apply in general. Maybe I will still open a new thread specifically for Portuguese down the road when it makes sense. ...... Now, the questions that brought me here: What are you guys doing with computer terms like "cache", "template", "email", "URL" and "link" to name only few, or more PW specific terms like "page tree" or "fieldgroup"? Are you translating them or leaving them in English between quotation marks? Also, should we discuss general Best Practices for all languages or just let the people responsible for each language to decide?
-
Hi Scott! Welcome to the forum! There isn't really a right way. One of the good things about PW is that it lets you create your own way of doing things. With that said, I think you are on the right track. You can create a settings page, with a settings template, and do exactly as you showed on your template file. The best way would be creating the "settings" template without creating a template file, since you will output the content through other files. For the footer, you can also do like you said, but I would keep it more semantic, like - instead of calling it footer, I would call it contacts, and copyright, and people... you get it
-
would be very nice to have a max-size(900)
-
what about adding the channel to PW's website? http://webchat.freenode.net/ edit: oops! there is no link to it.... well, just go to that link, and then "main menu" (top-left) and then "Add webchat to your site" edit2: and here is a custom link to bookmark http://webchat.freenode.net?channels=processwire&uio=d4
-
Still didn't read everything, but I'll answer to the TODOs. They can be conbined like this: $all_tags_pages = $pages->get("/tags/")->children; // they can edit: i was trying to answer your main question, but i won't have time right now and i don't understand how you have the pages organized on the tree. just two quick things: 1. Right now you are printing two <dt> for each <dd>. You will have to bring the <dd> out of the loop, and organize the things inside on a new list inside it. (sorry folks, i gave a wrong information, you can indeed have multiple terms per definition as well as the opposite) 2. you are not using the variable all_tag_pages anywhere in your code sorry, for not being able to help more for now. i'm sure someone will jump in soon
-
Hi Roman Welcome to the forum! There has to be a default language, PW needs it to know what to do in situations where it's not specified what language to use, but you can upload a new language to it and also change the title (just not the name). So, just choose one of the languages you need to be the default, and upload the files inside it. Right now the default should be English. If you are happy with that, upload only the other languages, and leave it as it is. Edit: same time as you Michael. Sorry for the repeated instructions
-
it says "Unable to complete this request due to an error. Error has been logged." when i press on any bar
-
And to delete lots of pages: $pa = $pages->find("selector"); foreach($pa as $p) $p->delete();
-
Hi jan, welcome to the forum! The module comes by default with 2.2 and is marked as beta. You just have to activate it in the modules page.
-
I also miss something like this
-
Downloaded and reverted the paths to the original ones, and it's all working
-
Nice, would be good to keep it as much portable as possible.