IRC logs

20160412

Logs from channel #fedext on freenode - our official support channel.

IRC log range: 20160412*

20160412

  • 04:50:32 <Fluidrules> Hi room. I have an f:image element, which gets its information from a flux:field.inline.fal field. The TYPO3 backend offers a "link" field for the editor, too. How do I get the entered information? I want the image to be wrapped with the link. No need for lengthy explanation, I think I can work with a working example I can copy off.
  • 08:46:17 <drlimbo> hi there
  • 08:46:27 <drlimbo> is there a way to use v:switch and v:case inline?
  • 09:15:21 <Fluidrules> drlimbo, there is inline syntax in the documentation, but I couldn't find a working example
  • 09:15:23 <Fluidrules> {f:switch(expression: [mixed])}
  • 09:25:33 <drlimbo> looks like =P
  • 09:36:13 <Fluidrules> here's case: {f:case(value: [mixed], default: 1)}
  • 09:37:22 <Fluidrules> so there's two problems - 1. What do you write instead of [mixed] and 2. how do you wrap the case around the switches if it's all inline?
  • 10:24:24 <Fluidrules> Are you still there, drlimbo?
  • 10:28:28 <drlimbo> yup sorry Fluidrules
  • 10:28:54 <drlimbo> i just jused a workaround with settings variables and use them inline
  • 10:29:27 <Fluidrules> sounds good.
  • 10:31:24 <drlimbo> its ok =P
  • 10:31:50 <drlimbo> but it would be interesting to find a solution for nested switch-case =)
  • 10:50:57 <Fluidrules> agreed, drlimbo. the examples database on fluidtypo3.org is extremely helpful, but non-devs like us need many more examples to grasp it. Maybe you have an idea how to solve my problem?
  • 10:51:16 <Fluidrules> I have an f:image element, which gets its information from a flux:field.inline.fal field. The TYPO3 backend offers a "link" field for the editor, too. How do I get the entered information? I want the image to be wrapped with the link.
  • 10:52:44 <drlimbo> where do u have the FAL field? in your extension Fluidrules?
  • 11:19:40 <Fluidrules> drlimbo: yes.
  • 11:19:57 <drlimbo> mh, so in your extbase extension?
  • 11:20:10 <drlimbo> or just in fluid?
  • 11:20:12 <Fluidrules> it's a content template (FCE) in a fluidcontent extension
  • 11:20:23 <Fluidrules> just a provider extension for the template
  • 11:20:37 <drlimbo> ah, so you need to get the FAL Files with v:resource.record.fal
  • 11:20:56 <Fluidrules> that sounds good
  • 11:20:58 <drlimbo> for example: {v:resource.record.fal(record: page, field: 'media', table: 'pages') -> v:variable.set(name: 'pageMedia')} to get the "Ressources" Images from Page
  • 11:21:33 <drlimbo> and dont forget the "treatIdAsReference: 1" setting in the image viewhelper
  • 11:21:34 <Fluidrules> I get the src, title and alt from {v:content.resources.fal(field: 'settings.image1') -> v:iterator.first() -> v:variable.set(name: 'image')}
  • 11:22:27 <Fluidrules> v:resource.record.fal vs v:content.resources.fal
  • 11:23:07 <drlimbo> ah, and dont use FAL-Images in a section - this wont work
  • 11:23:39 <Fluidrules> it works I just need the link
  • 11:25:02 <Fluidrules> I use e.g. <flux:field.inline.fal name="settings.image2" label="Image large" /> in the form and {v:content.resources.fal(field: 'settings.image2') -> v:iterator.first() -> v:variable.set(name: 'image')}
  • 11:25:02 <Fluidrules> <f:image src="{image.id}" title="{image.title}" alt="{image.alternative}" /> in the section.
  • 11:27:36 <Fluidrules> what would really help is an example of how to get a single FAL image with the link wrapped around.
  • 11:28:37 <drlimbo> there's a viewhelper to get the image url (resource.url something..)
  • 11:30:36 <Fluidrules> are you sure that's not just the path to the image?
  • 11:31:10 <Fluidrules> ... that would be the src...
  • 11:31:20 <drlimbo> https://fluidtypo3.org/viewhelpers/vhs/master/Uri/ImageViewHelper.html
  • 11:33:24 <Fluidrules> Maybe I'm explaining it badly. I know how to output the image.
  • 11:34:22 <Fluidrules> in the backend there is a field where you can assign a link to an image. That means, the image should be 'linked' with a URL, e.g. google.com.
  • 11:34:37 <Fluidrules> But I don't know how I can use this link in my frontend.
  • 11:44:03 <Fluidrules> it's not in <f:debug>{settings}</f:debug>
  • 12:02:53 <Fluidrules> can't find it in <f:debug>{all}</f:debug> either.
  • 12:05:04 <Fluidrules> found it... image.link
  • 12:05:37 <Fluidrules> works only when I debug just below the image tag in my Main section.
  • 12:10:28 <Fluidrules> now I need a conditional: if there's a link, wrap a link around the image, if not, don't wrap anything.
  • 12:13:06 <Fluidrules> solved, like this: {v:content.resources.fal(field: 'settings.image2') -> v:iterator.first() -> v:variable.set(name: 'image')}
  • 12:13:11 <Fluidrules> <f:if condition="{image.link}">
  • 12:13:15 <Fluidrules> <f:then>
  • 12:13:21 <Fluidrules> <a href="{image.link}"><f:image src="{image.id}" title="{image.title}" alt="{image.alternative}" /></a>
  • 12:14:05 <Fluidrules> and so on. Maybe this helps someone else. Take care, everybody.