Fork me on GitHub

Pagesetter Adding Variables?  Bottom

  • I'm creating a site for my mortgage company and I'm trying to use Pagesetter to display current interest rates, Rate Sheet.

    Is there any way after I define 1 variable of what I'll call baserate, which for example I would update each day, and publish a new document. Today I would call the baserate 6.

    In my template what would I need to put to add #'s to the base rate.
    For example, a cash out refinance I would need to add .5 to the base rate, and I would have many rates, but would all depend on the base rate. How can I translate this very simple math?
  • Yes. mmmh let me think

    1. add a new publication type called "baserate" with only that one field called "baserate"
    2. publish a new article for that pubType with your first value - say 5
    3. open the template of the other publication type - there where you need that value added
    4. Say you called that value here "int" (e.g. 3 )and you want to all your baserate (e.g. .5)to it. the value you entered as baserate is 5 so you need to combine the strings "3", "." and "5" while the numbers are contained in the variables $int and... yes - where is the baserate?
    5. fetch the baserate. As your publication in the baserate publication type was the first I assume it has the ID 1 and As you have one other publication type I assume that the baserate type has ID 2 So it's tid=2 and pid=1
    You can get all the values with this code:

    Code

    <!--[ pnmodapifunc modname="pagesetter" type="user" func="get" tid=2 pid=1 assign="baserate" ]-->

    6. As I haven't tried what I write here, You should test if this works. I am not sure if "get" is the right API call. Add

    Code

    <!--[ pndebug ]-->
    at the end of the template and check the popup (popupblocker!) for the baserate. When it's there I assume on the left column it says "baserate" and also on the right side "baserate"
    7. Now back to combining the strings. I am not too sure how that works, but AFAIK it should work like this:

    Code

    <!--[ capture name="myFactor" ]--><!--[ $int ]-->.<!--[ $baserate.baserate ]--><!--[ /capture ]-->

    8. Now you have a new variable called "myFactor" and you can use that to make your equations. e.g.:

    Code

    <!--[math equation="x*y" x=$price y=$myFactor]-->


    For more infos on the template stuff check out the Smarty manual or my pnRender CheatSheet

    As I said: I didn't test all this. You have to look into it yourself but I think I pointed into the direction. If you like you can buy me a small thank you icon_wink

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the Zikula Steering Committee
    Read The Zikulan's Blog "If you want people to RTFM, make a better FM!"

This list is based on users active over the last 60 minutes.