-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
F wooot PW isn't good at? You mean for on a new site? Something like Profile Exporter could come in handy. Also you could pretty easy create a field template creator via API. Limitless and simple. Edit: For locally tasks, also there's clone feature in PW. Go to /site/config.php and enable advanced mode. Welcome to advanced pro mode! Now you can under the tab advanced, clone fields and templates using a checkbox and save, then rename.
-
Use google to search processwire.com "site:processwire.com keyword"
-
It's there to tell PW that the value has changed.
-
I'm not sure I understand. You don't check if there's an image and without debugging turned on in site config it may fail silently. Hard to help without seeing the output and more. However, to check if a image is there you could change to something like this <?php if(count($tour->images)): ?> <img src="<?php echo $tour->images->first()->size(200,0)->url; ?>" width="200" class="picture"> <?php else: ?> <p>(NOIMAGE)</p> <?php endif; ?>
-
I also tried something similar as your code, but it didn't work regardless of what I tried. I think I missed the $page->images->sort("sort"); and to do the trackChange on the field instead of the sort or page. Thanks Ryan for clarifying. I don't get why removing and readding would be a problem. Seems to work well. Edit: Just wondering, but why does echo $image->sort not output anything?
-
What are you using? This isn't php... No, you want to do: <img src="<?=$project->images->first()->size(200,0)->url;?>" width="200" /> or <img src="<?=$project->images->first()->widht(200)->url;?>" width="200" />
-
diogo, sure $img = $page->images->first(); $page->images->remove($img); $page->images->add($img); $page->save(); and the first image is at last position
-
I think the only way is to remove the images and add them in the new order again. So you could construct a form with this in mind.
-
I think you're looking for something like this: <?php foreach($page->children as $project) { echo "<h2>{$project->title}</h2><p>{$project->body}</p>"; foreach($project->images as $img) { echo "<img src='{$img->url}'>"; } } ?> $project->images is an array if the images field is set to multiple. If it's a limited to 1 image field your code would work. Or to get for example the first image from the stack, you could just access it using $project->images->first()->url;
-
As a php notice where the field label text output would be. Maybe your server has notices disabled.
-
When I tested your code 1:1, and turned on debug. It showed me the warning that the $language var doesn't exist.
-
Ah just posted same time. You should then do this: The default would be "". Field labels use "anno1299" where 1299 is the id of the language. The default would be just "anno"; $language = ''; if($input->get->language) { // user clicked on a link to set the language $name = $sanitizer->pageName($input->get->language); $language = $languages->get($name); if($language) $session->language = $language->name; } if($session->language) { // language is defined in user's session $user->language = $languages->get($session->language); $language = $languages->get($session->language); } Always remember to try to debug. You can then see errors and warnings you don't see without. Turn it on in the site/config.php
-
Not sure, have you debugging turned on?
-
Looks ok to me. I can switch language just fine.
-
Nesting Fieldset and FieldsetTab doesn’t work
Soma replied to Michael van Laar's topic in General Support
Ryan, according to his post, he already tested default theme.- 5 replies
-
- fields
- FieldsetOpen
-
(and 1 more)
Tagged with:
-
Let me search that for you Default language: Everything about displaying languages in frontend: http://processwire.com/api/multi-language-support/multi-language-fields/
-
I think I recognized that if a template has no php file it doesn't have the publish behavior. Not sure about others.
-
Ah that's something different. You could try something like this: 'item_tpl' => '<a href="{redirect_url|url}">{title}</a>' Then it will take the redirect_url if it's populated.
-
There's no way to do this in php, this has to be done in html or js client side. There's nothing against using target blank in HTML5. If you don't want to, you could add rel="ext" to the links and use jquery to make them behave like you want. This technique was often used in XHTML where target blank wasn't valid. Add it using javascript $("a[rel='ext']").attr("target","_blank"); Or using only the protocol, with any link that href starts with http:// $("a[href^='http://']").bind("click", function() { window.open( $(this).attr("href"), "_blank" ); });
-
TItle is needed for all pages. You can't change it to 'id' because it's a reserved word in PW. Why not just let it named title or add another field for?
-
Maybe because ProcessWire uses url already? $page->url
-
When I'm angry at Ryan I'm using this: javascript:var%20s%20=%20document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);
-
jQ ui datepicker has languages http://jqueryui.com/demos/datepicker/localization.html It would be easy to just include the required [lang].js depending on admin language.
-
Show highlighted search keywords in search results?
Soma replied to MarcC's topic in General Support
I would pick js. Advantage would be that you can specify the context, to only highlight words in content for example, and you transfer the overhead to th client. Other than that it is personal preference. It would also be possible with a simple hook to page render and replace words in the output. -
Show highlighted search keywords in search results?
Soma replied to MarcC's topic in General Support
If you use jquery theres some easy way and do it client side. If you add ?q=searchword to the search result links it's easy possible. Some helpful links To get a url parameter http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery An lightweight plugin to highlight the word on page http://bartaz.github.com/sandbox.js/jquery.highlight.html