• Content count

  • Joined

  • Last visited

  • Days Won


heldercervantes last won the day on July 26 2016

heldercervantes had the most liked content!

Community Reputation

150 Excellent

About heldercervantes

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Porto, Portugal

Recent Profile Visitors

1,705 profile views
  1. In my last couple of projects I've used a hacked version of this module with an extra field for inputting image map coordinates. With a little snooping around and a good dose of patience my lack of module building knowledge didn't stop me So now this shopping centre's website has a store locator where you can hover hotspots, the marker appears in place and everything is configurable in the CMS. Before this was a Swiffy converted flash object. Here's the result in the frontend: http://www.miramaiashopping.pt/lojas/ And here's what it looks like in the CMS: Now I do have another project where I also have to add hotspots to an image for showing some text. But for that the module needs some serious work. I'm just going to make subpages of a type that only has a body field and use that. It would be cool to have this work like a repeater where you have full control of the fields for each marker and only link to pages if you need to, but that would mean rebuilding from the ground up.
  2. Already did, no cigar. If I get the first langFiles->lang, it returns 1010, same as outputting $user->language. Comparing those in an IF statement works, but the find returns nothing. I tried: find('lang.name='.$user->language->name); find('lang='.$user->language->id); find('lang.id='.$user->language->id); Nothing works. I even tried adding a title field and fake a string and still get nothing. Something's preventing that from working. But that foreach solves the problem and in this small site performance won't be an issue so I give up streamlining more.
  3. Found a pretty cool solution for this. Repeater + Page + Files. So I set up a repeater called langFiles. Inside that repeater I added a Page selector called lang and the files field. The page selector is set to be a single select, by template = language. So in the admin I get a repeater, add an item, select the language and upload the files. Add another one for the second language, and so on. Then on the frontend: // Somehow $page->langFiles->find('lang='.$user->language) doesn't work foreach ($page->langFiles as $lf) { if ($lf->lang == $user->language) { $filesRepeaterBlock = $lf; break; } } if ($filesRepeaterBlock->files->count) { echo '<ul>'; foreach ($filesRepeaterBlock->files as $file) { echo '<li><a href="'.$file->url.'" target="_blank">'.$file->name.'</a></li>'; } echo '</ul>'; } And there it is. Add a new language tomorrow, and it adapts. And it's not too weird for the admin.
  4. I think I misinterpreted you. Your approach is to add a file field for each language?
  5. Thx adrian, but this doesn't seem to work for file fields. Even with outputformatting set to false I always get the default language.
  6. Hi forum, I'm implementing a site where a files field needs to be language-sensitive. I don't mean descriptions, but the files themselves need to be different according to language. I could have a field for each language, but that would mean having to add new fields if we add new languages later on. So my attempt was to use the description as a filter. If there is one, show the file, if not ignore it. So a file that has a description only for english would only show when viewing english. But the description defaults to the main language. Is there a way to get the actual description on a given language without defaulting when it's empty? Or some other approach that's minimally elegant for this problem. Thanks, H
  7. Thanks for the tip @kongondo
  8. Hello fellow PWers. Today I'm proud to be doing my first installation of Form Builder on a project. Been waiting a while for this opportunity. However I'm stuck. I want to add a field on a template, where the user can select which form to embed there. I could just use an Options field and add the form list there manually, but it would be nice to have something more elegant that displayed all available forms and that updates options automatically if new forms are created. My first thought was Page Select, but it seems FB's forms aren't saved as pages. Any ideas? Thanks, H
  9. Thanks guys. Strip_tags worked like a charm
  10. Hello chaps. Anyone know a smart (as in short and sweet) way of rendering a textarea that is configured to use CKedit, as plain text? The regular, html version of the field's content is used on the page, but then I need a clean alternative version for some cases. Thanks, H
  11. Thanks for your help. I used Ryan's suggestion of starting the path to my includes with "./" <?php include('./includes/footer.inc.php'); ?> Worked like a charm.
  12. Hi guys. I'm having this weird problem with translatable text. I have it in just about every template of the site and it works fine with one exception. In every template I'm including a footer, using a regular: <?php include('includes/footer.inc.php'); ?> Then in that file I have this: <footer> <div class="row"> <div class="slogan"><?= $home->slogan; ?></div> <div class="social"> <?= __('Follow us'); ?> ... That "follow us" string shows up to be translated on the cms, and so does a second string I have a few lines down, but on the frontend it always renders what's in the code. It doesn't replace with what's set on either the current language or the default language. Just ignores everything. Any idea what's going on here? Thanks, H
  13. Freakin awesome! @teppo: site of the week right here.
  14. I'm doing a modded implementation on a new project using PW 3.0.41 right now. Works like a charm.
  15. Module

    Either I'm missing something or the module is not working properly in version 3.0.33 devns. I installed it, configured my basic page to be included and sure enough started seeing page edits appear listed on the history tab, even identifying the changed fields correctly. However, preview always shows the current version and revert has no effect.