-
Posts
4,314 -
Joined
-
Last visited
-
Days Won
80
Everything posted by diogo
-
You will always have to do something in the markup. To make a AJAX call you would have to rely on some markup anyway, I think adding the link to the page is the most transparent way to do it.
-
Hi KunGu, welcome to the forums! Eheh, you chose the most difficult way to start I don't thing that's a bad thing but I would suggest that you also do some test with the direct output, since it's the simplest to understand and most common way in CMS integration. Just to have a feeling of how it works. With the delay output, you got it right, Heredoc is one way to go. Other way is to concatenate the html pieces like this: // ultra simplified example $myVariable = "<p>"; $myVariable .= "content"; $myVariable .= "</p>"; You can also include the content of an external file into a variable in two ways: ob_start(); include('slider.inc'); $myVariable = ob_get_clean(); or: $myVariable = file_get_contents('slider.inc')
-
Thanks dragan. We're aware that the translations have some problems, although there was a professional translator involved. We will still pass your comment to the client.
-
You can use a pageArray method instead of exploding things: if ( $pages->get('template=home')->featured_items->has($project) ) I actually showed this to you not that long ago https://processwire.com/talk/topic/10440-checking-array-for-a-value-might-be-more-php-question-than-pw-sorry/?p=98786
-
if($page->related_projects->count > 0)
-
You simply create a new template with a multilanguage text field for each expression you want to translate. the name of the fields and labels can be in english, but not necessarily the words that you will output, they would be just informative. Then you fill the fields with all the languages. To output them in other templates, you would do this: // top of the file $translations = $pages->get('/translations/'); // and when needed echo $translations->more_articles; // inside functions echo wire('pages')->get('/translations/')->more_articles;
-
I would probably create a page "site wide translations" in the admin and have these as fields there.
-
Checking array for a value (might be more PHP question than PW... sorry)
diogo replied to a-ok's topic in General Support
"1025|1074|1026|1027" is only returned when you echo, because PW converts the object into a string only for this purpose. If you want to know if a page exists in a pageArray, you should use the pageArray methods, in this case: if ( $project->project_tags->has(1025) ) Edit: LostKobrakai was faster -
This exact search could be simply: $pages->find("parent=/landscape_stone/natural/flagstone/, color=brown|gray, size=medium")
- 1 reply
-
- 2
-
-
Thanks Mike! I didn't even notice that I was using an old version. Linked to the latest and changed the speed to 25.
-
I changed the setting. 50 was definitely too fast for me, even 30 was, so I settled with 15 for now (default is 3), can you win7 guys please check if t makes a difference for you? Many thanks!
-
Thanks guys, I will try this fix.
-
It is possible, it's just not designed for that. See here https://processwire.com/talk/topic/10226-getting-fields-in-a-fieldset/
-
Yep, I saw it meanwhile. For now I "solved it" with css .ui-loader + .ui-page { display: none; } Later next week I'll try to actually fix it.
-
Thanks! I don't have that feeling. Anyone else had this experience? Oh boy... It's funny, this did happen to the client in her browser and it stopped after a couple of changes i did. I stress tested the site on some browsers and was never able to reproduce it. This happened to you on the iPhone? EDIT: not ideal, but for now I solved it with CSS. Yep, caching scroll offsets would be a good enhancement. Will have a look at it. Hm... -- Many thanks for your feedback guys!
-
Hi Guys, The second website website that we launched this week http://follow-us.pt/ It's a one-page website for a company offers tailored architectural tours in Porto and North of Portugal. They asked us to do something completely different from the other companies that offer guided tours. Although this is a very simple site, there are two details that we're proud of technically the two columns scrolling in different speeds so they stop at the same time, although they have different heights; and the responsive connection between the two rectangles from the logo and headline, crafted with SVG. Hope you like it
- 1 reply
-
- 11
-
-
Hi guys, So, here is our latest creation. http://wine-route-georgia.com/ Wine Route Georgia provides exclusive tailored tours throughout Georgia including wine tastings and vinery visits. We were lucky to have a great set of images to work with, so we decided to design the website around them. The strategy was to keep the images in the background with a very slow slideshow, and for this we had make sure that it wouldn't be interrupted while the user navigates the content. Enter AJAX: Obviously the only way to do this is to use AJAX to get the requested content. We wanted the URLs to work normally and used this technique to make sure everything would work flawlessly http://rosspenman.com/pushstate-jquery/ . On PW the work was not different than a normal website with separate pages (including header and footer) since all the work is done with JS. The slideshow is quite complicated because it works differently when in responsive mode. On smaller devices, the slideshow pauses and becomes draggable. On larger devices you can call a grid with all images and select the one you want to see next. This is a completely custom behaviour for a slideshow and of course there is no jQuery plugin that does this by default, but after some frustration I found a plugin with an excellent API that allowed me to program it exactly how we wanted http://kenwheeler.github.io/slick/ Hope you like it.
- 17 replies
-
- 14
-
-
Modx MODX content (including images) to ProcessWire
diogo replied to Peter Knight's topic in General Support
There you have your answer! Loop through all the pages in your PW install, get the url, pass it to a DOMparser, find all the images inside the content section from that page, get their url, and store them in this page image field. Pseudo-code: foreach ( $pages->find("template=all|imported|pages") as $p) { $html = file_get_html($p->old_url); foreach( $html->getElementById("content")->img as $img ) { $src = $img->src; // The image url is $src now // see the in this post in the cmscritic case study // how to extract the file name, and use both the url and filename to import the images to the page in $p } } -
The simple solution is: .MarkupPagerNav li { display: none; } .MarkupPagerNavPrevious, .MarkupPagerNavNext { display: inline; } --- EDIT: actually, did you try to set the "numPageLinks" options to 0? $results->renderPager(array( 'numPageLinks' => 0 )); I don't know if it works, but it's worth trying
-
Try reversing it. You want to sort by created only if news-date doesn't exist, so it should be news-date|created. I'm also not sure if you can reverse the sorting by adding a minus behind each property or if it would work instead simply with: sort=-news_date|created. If it doesn't work like that you can always leave the sort without the minus and use ->reverse() to reverse the order of the pageArray instead.
-
Steve, you should make a t-shirt for Textile. Somehow it fits
-
When you look for a solution, this is the one that always comes up http://ben.kulbertis.org/2011/10/synchronizing-a-mysql-database-with-git-and-git-hooks/, it's worth a shot Edit: https://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/
-
I think the comments there say it all about the value of that post. About the the paragraph that you quoted, obviously you have to be clear about this with the client.
-
Hi Cerulean, Thanks for the feedback. I think adding a field to a system template should be done in an informed way by the user of the module, especially if it's a quite quick thing to do and if it won't be needed in all cases. I will update the documentation to be more explicit, though.
-
Those pages would be language agnostic, so you (your editor) would have to fill the default language name and title, independently of what language it is, and ignore the others. I'm not sure if there is a way to avoid showing the language names based on the template and can't check right now. EDIT: for the Title you can create a non-multilanguage title and use tat one on this template, my doubt is with the page name.