Keyword

if else on extrafield

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 10 months ago #156014 by Krikor Boghossian
Replied by Krikor Boghossian on topic if else on extrafield
Let's try another approach. Strange issue indeed.
<?php if ($extraField->id == 1): ?>
  <?php if ( $extraField->value != '' && $extraField->value != ' ' && !empty($extraField->value)  ): ?>
  <?php endif; ?>
<?php else: ?>
  Do something
<?php endif; ?>

Let's see if this does the trick.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • John-Eilif Eliassen
  • John-Eilif Eliassen's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 10 months ago #156017 by John-Eilif Eliassen
Replied by John-Eilif Eliassen on topic if else on extrafield
Oh as I was hoping. Crossing my fingers and everything. But to my dispair when i tried this it acted as before with only showing IF there is value to the extrafield...

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 10 months ago #156019 by Krikor Boghossian
Replied by Krikor Boghossian on topic if else on extrafield
At this moment I think sacrificing some poultry might be a reasonable choice.

However, I am against animal cruelty so... is it possible to see a screenshot of these extrafields?
I would also like a screenshot of the database cell.

It is possible that these fields DO hold some value (whitespace).

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • John-Eilif Eliassen
  • John-Eilif Eliassen's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 10 months ago #156022 by John-Eilif Eliassen
Replied by John-Eilif Eliassen on topic if else on extrafield

Krikor wrote: At this moment I think sacrificing some poultry might be a reasonable choice.

However, I am against animal cruelty so... is it possible to see a screenshot of these extrafields?
I would also like a screenshot of the database cell.

It is possible that these fields DO hold some value (whitespace).


It is weird, right. And ot, I too am against animal cruelty.

I will provide a snippet of the database asap. I changed the extrafield from being a LINK type to being a textfield. So the ID of the field is now naturally 2.

This is the extrafield i added and viewed from additem page.
imgur.com/PPQlIRv
imgur.com/9gQro7a

Module setting
imgur.com/sfv83nd

Category setting
imgur.com/xruNvPT

I am not competent enough to solve this by myself as i've tried everything i found by searching this forum and the web in general, so I truly and genuinely appreciate your effort Krikor!

OT: Do you know the difference between a blonde and a mosquito?

Please Log in or Create an account to join the conversation.

  • John-Eilif Eliassen
  • John-Eilif Eliassen's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 10 months ago - 7 years 10 months ago #156026 by John-Eilif Eliassen
Replied by John-Eilif Eliassen on topic if else on extrafield
Here is the table from "db__k2_extra_fields".
IDNameValueTypeGroupPublishedOrdering
2KS{"name":null,"value":"","target":null,"alias":"KS","required":0,"showNull":0}textfield112
Last edit: 7 years 10 months ago by John-Eilif Eliassen.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 10 months ago #156027 by Krikor Boghossian
Replied by Krikor Boghossian on topic if else on extrafield
I would love to know the difference.
I have to point a couple of issues.
a) Backup and update to K2 2.7 or K2 2.7.1 DEV - github.com/getk2/k2

b) Can you try with a newly created extrafield?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • John-Eilif Eliassen
  • John-Eilif Eliassen's Avatar Topic Author
  • Offline
  • Senior Member
More
7 years 10 months ago #156046 by John-Eilif Eliassen
Replied by John-Eilif Eliassen on topic if else on extrafield

Krikor wrote: I would love to know the difference.
I have to point a couple of issues.
a) Backup and update to K2 2.7 or K2 2.7.1 DEV - github.com/getk2/k2

b) Can you try with a newly created extrafield?


I tried with a newly created field, did nothing to the behaviour.

Updates when upgraded.

You dont smack the blonde when the sucking starts.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 10 months ago #156053 by Krikor Boghossian
Replied by Krikor Boghossian on topic if else on extrafield
Hehehehe nice one :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum