• Content Count

  • Joined

  • Last visited

Community Reputation

17 Good

About ngrmm

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,488 profile views
  1. the website has several languages: english, german, … (left-to-right) and arabic, farsi (right-to-left) englisch is the default-language but only some parts/fields are translated. everything works fine. if a text-field has no translation, the default-language will be shown instead. BUT there is a problem: when user-language is arabic (rtl) i just want to set "dir=rtl" or a class on those div's with arabic-language output. i tried it this way. But got an error. I thinks it's because the second field is from another $page. Anyway this isn't the best way because $rtl and $langclass should be unique. Whats the best way to solve this problem? $userLang = $user->language->name; $userId = $user->language->id; $page->of(false); // turn off outputFormatting (if it's not already) // get unformatted textfields $body = $page->body->getLanguageValue($userLang); $otherPageTitle = $otherPage->title->getLanguageValue($userLang); // check if user lang is rtl if($userLang == 'fa' || $userLang == 'ar') { // check if var translation exists if(!$body == '') { $rtl = "dir='rtl'"; $langclass = "rtl"; } // no translation: output default else { $body = $page->body->getLanguageValue('default'); } // check if var translation exists if($otherPageTitle != '') { $rtl = "dir='rtl'"; $langclass = "rtl"; } // no translation: output default else { $otherPageTitle = otherPageTitle->getLanguageValue('default'); } } echo "<div class='$langclass' $rtl >$body</div>"; echo "<div class='$langclass' $rtl >$otherPageTitle</div>";
  2. ngrmm

    i installed the module and its working fine! thanks @bernhard the module uses the pw-InputfieldSelect output. is this the reason why the current template is always at top/first place? is there a way to change that? i just want to keep the sorting.
  3. ngrmm

    i was able to get it this was: $files = glob("../dir/*.*"); $files = array_combine($files, array_map("filemtime", $files)); arsort($files); $latest_file = key($files);
  4. i have jpegs inside a folder (images). the folder is located in the templates-folder of PW site > templates > images every 30 minutes a script generates and saves jpegs into the images-folder. the all have a unique filename. is it possible to save all those images into a image-field through API? if not, is it possible to add the newest one into the imagefield? i found this $p = $pages->get(1001); $p->of(true); // if in a template code, turn off output formatting $p->images->add(""); $p->save(); $p->of(false); but i don't know how to grab the url automaticly of the newest file.
  5. ngrmm

    thx @lokomotivan actually i was able to append a div with javascript and to use it as a overlay. ps: i also found this
  6. ngrmm

    thx @Sergio i found this one and give it a try
  7. ngrmm

    thx, good idea but i need IE11 support
  8. is there a way to output jpegs with a color-overlay? i'd like to have a transparent image with a black background. the admin should be able to set the opacity. unfortunately i'm not able to change the dom-elements or add some. so, i have a div with a background-image and a field where i can set a number (0 – 100). is there a way to let PW create an image with some kind of a color-overlay to darken an image?
  9. ngrmm

    all of a sudden module stopped working. i do not use any caching. i'm a bit puzzeld what happened any changes from facebook?
  10. ngrmm

    /old-dir/{all} -> /new/ was exactly what i was looking for. thanks!
  11. ngrmm

    is there a way to setup a a redirect for all files and children-directories of a directory example: /old-dir/ /old-dir/child-a/ /old-dir/child-b/ /old-dir/child-b/test.jpg they all should be redirected to /new/ can this be achieved by just one rule? something like /old-dir/* > /new/
  12. ngrmm

    thanks everyone. i changed them manually, wasnt that much. but link abstraction is a nice feature!
  13. ngrmm

    it's like <img src="/test/site/assets/files/1060/image.jpg"> and should be <img src="/site/assets/files/1060/image.jpg">
  14. i moved the whole site from a sub-dir into the root dir domain.tld/test/ -> domain.tld/ but now all inline images in ckeditor-fields have the old-urls (dmain.tld/test/….jpg) is there a way or a module to fix that?
  15. ngrmm

    i manage to get it this way. but i think there should be a better way echo "<div class='items'>"; $odd = array(); $even = array(); echo "<div class='odd'>"; foreach ($allPages as $k => $v) { if ($k % 2 == 0) { $even[] = $v; echo "<div>$v</div>"; } } echo "</div>"; echo "<div class='even'>"; foreach ($allPages as $k => $v) { if ($k % 2 !== 0) { $even[] = $v; echo "<div>$v</div>"; } } echo "</div>";