Search code examples
variablesglobal-variablesenvironment-variablestypo3datastore

With Typo3, is it possible to have some kind of data store?


I've worked with Typo3 for a few years, but I mostly used it as a CMS. Now I have a specific need and can't figure out if I need to find an extension, write TypoScript or if this need can be filled with an existing Typo3 feature.

The documentation being what it is, here I am.

The need I have is similar to needing a taxe rates table (it's not my case so don't point me to some taxe rates management extension).

I need to have variables set in some data store and display this data on the frontend in function of the date. For example :

Effective date             Rate

2010-10-01                 10,00$
2011-10-01                 10,50$
2012-10-01                 11,00$

Basically, I need a non technical user to be able to edit this data store and I need to be able to use this rate on the frontend as a variable.

I'm pretty sure someone has one something similar in the past. I'm just a bit lost with Typo3.

Anyone knows the best way to do this?

Thanks.


Solution

  • Just a rought guess:

    You could create a new Extension "yourextension" with an table "tx_yourextension_rate" with the kickstarter. Add the fields "effective date" and "rate" including start/stop times. Install the plugin - you will only need the table, no plugin!

    Create a folder where your users stores the records.

    lib.rate = CONTENT
    lib.rate {
      select {
        # create a folder, where your users stores the records:
        pidInList = 100 
        # just one record
        max = 1
        orderBy = effective_date ASC
      }
      table = tx_yourextension_rate
      renderObj = TEXT
      renderObj {
         field = rate
         wrap = actual rate: <span class="rate">|</span>
      }
    }
    

    Use lib.rate where you need.