Jump to content

Thomas108

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Thomas108

  1. Hhm, I tried that already before and now again. Doesn't work for me somehow. The output remains empty. (On my page of course I entered a description in the file description field.) <?php foreach($page->mp3_repeater as $mp3) { echo "<li><a href='#' data-src='/processwire/site/templates/audio/$mp3->mp3_url'>$mp3->description</a></li>"; } // results in <a href="#" data-src="/processwire/site/templates/audio/song-1.mp3"> </a> ?> Any other idea what could be wrong?
  2. Dear processwire folks, i am trying to output the description of a file field within a repeater, but despite extensive forum search I can't find the right syntax. Here is one of my approaches: <?php foreach($page->mp3_repeater as $mp3) { echo "<li><a href='#' data-src='/processwire/site/templates/audio/$mp3->mp3_url'>$mp3->$file->description</a></li>"; } ?> Thanks for your help.
  3. Thanks for your answers and advice. Now the include worked. I must have done something wrong somehow, when I unsucessfully tried to use include before.
  4. Hello everyone, I am new to processwire and this is my first post. I am coming from the modx world, and I am unfortunately really bad in php. Nonetheless after silently reading here for a few weeks I think that processwire might be just the right cms for my needs. At the moment I am doing a website for a musician and I will probably have quite a few beginner questions. Thanks for your help and patience in advance Thomas ********************************************************* Here is my first question: My pages have basically the same layout, so I would like to have only one template file. But there will be a few extras on certain pages, like one page with a calendar and one with an audio player. I thought it would be wise to put the code for the audio player or the calendar in an external file or page to keep my template file simple to read. To do this I tried to "echo" or "include" an external php file, but the php didn' t get processed. <?php if ($page->id == 1032)//home {echo "<h2>Welcome...</h2>";} elseif ($page->id == 1017)//dates {echo "how to include external code here?";} ?> Is there a processwire way to do this and is this in general a good approach? Thomas PS: I read the different modx threads already.
×
×
  • Create New...