• Resolved Sportuojantys

    (@needfeed)


    Hi, I wanted to ask is it possible to get an answer of the calculation directly on top of the image?

    For example, images is here:
    https://ibb.co/8D22wcVq

    Spots for calculation field answers are circles marked as A, B, C, D, E.

    So maybe I can tell the coordinates of the images to CFF and it would make these answers appear on these circles in the image?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @needfeed

    Yes, of course that’s possible.

    Assuming you have loaded the image into an “HTML Content” field, and the calculated field is the fieldname123, you can include a span tag (or any other tag) in the HTML Content field positioned with CSS in the place you prefer, and use the data-cff-field attribute:

    <span data-cff-field="fieldname123"></span>

    The plugin will display the fieldname123 value in the tag.

    Finally, as the calculated field is used as an auxiliary, you can hide it by ticking a checkbox in its settings.

    Best regards.

    Thread Starter Sportuojantys

    (@needfeed)

    I loaded image using Media field, is it bad? How should I load it with HTML content field? With a link of ibb URL, etc?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @needfeed

    Loading the image with “Media” control is not bad, but you cannot include other tags with it. Using “HTML Content” fields gives you more control over the information to display.

    I recorded a video to teach you the process. Please visit the following link:

    https://resources.developers4web.com/cff/tmp/2025/03/21/image-label_o.mp4

    Best regads.

    Thread Starter Sportuojantys

    (@needfeed)

    Thank you for the great video!

    I have little problems with easy thing (not easy for me).

    In fieldname6 I have the data input, hich has format like this: mm/dd/yyyy

    Example: 23/03/2025

    I need output like this:

    fieldname8 is counted like this: dd number (for example: 23) would be added just like it is if its 22 and lower (from 1 to 22).
    if the dd number is bigger than 22, than the numbers of that number should be sumed, for example if 23, it’s bigger than 22, so it should be 2+3=5 and it would be 5. if its 28, then 2+8=10 and so on.

    fieldname9 is counted like this: mm number (for example: 11) would be added just like it is: it’s 11 in this case.

    I tried with dd in fieldname8, but my function not working:

    function() {
    var date = fieldname6;
    var day = date.substr(0, 2);
    day = parseInt(day, 10);

    if (day > 22) {
    var daySum = 0;
    while (day > 0) {
    daySum += day % 10;
    day = Math.floor(day / 10);
    }
    return daySum;
    } else {
    return day;
    }
    }

    Should I add HTML Content field? Because I only using different fieldnames for different numbers in the date: dd/mm/yyyy

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @needfeed

    The process is simpler by using the plugin operations.

    Assuming the date field is the fieldname6, the equation would be:


    (function(){
    if(fieldname6|r == '') return;
    let d = DAY(fieldname6);
    return IF(d<=22,d,SUM(String(d).split('')));
    })()

    Best regards.

    • This reply was modified 4 days, 3 hours ago by CodePeople2.
    Thread Starter Sportuojantys

    (@needfeed)

    Hi, thanks you, it works, but I can’t find the proper CFF documentation page with this type of data, can you share a link here?

    I can’t find anything related to your formula operations (r and ==) here:
    https://cff.dwbooster.com/documentation
    https://cff.dwbooster.com/faq

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @needfeed

    Yes, of course. The Date/Time operations are described in the “Date Time Operations” module:

    https://cff.dwbooster.com/documentation#datetime-module

    The “IF” operation in the “Logical Operations” module:

    https://cff.dwbooster.com/documentation#conditions-module

    The use of the modifiers, like “|r”, “|n”, and “|v” is described in the yellow box in the section that describes the structure of the equations:

    https://cff.dwbooster.com/documentation#modules

    The “SUM” operation is part of the “Mathematical Operations” module:

    https://cff.dwbooster.com/documentation#mathematical-module

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.