Menu

Adding new Blocks

Help
2004-06-19
2004-06-20
  • Ken Nordberg

    Ken Nordberg - 2004-06-19

    Question: On the welcome page it's possible to add blocks of information like News, Random Media, Favorites, etc. Now, I have a family crest I would like to display in it's own little block on the right side of the screen, kind of like the random media block, but with the same picture showing every time. How would I go about doing this? I have added the necessary code in functions_blocks.php, bit I don't know how to "activate" it so to speak, so that it will show up in the block selection list and actually display on the screen when I select it.

    Any help is greatly appreciated.

    Ken.

     
    • John T

      John T - 2004-06-20

      In a reply to my post John said this
      "Here is the breakdown of the PGV_BLOCKS array:
      $PGV_BLOCKS["print_gedcom_news"]["name"] = $pgv_lang["gedcom_news_block"];
      The element in the first array, in this case the "print_gedcom_news" index, is the name of the function that you want to run. The "name" element is the human readable form of the name. In this case it gets translated to "Gedcom News".

      $PGV_BLOCKS["print_gedcom_news"]["descr"] = $pgv_lang["gedcom_news_descr"];
      This line adds a textual description for the "print_gedcom_news" function. This textual description appears in the customize window when it is selected in the list.

      $PGV_BLOCKS["print_gedcom_news"]["type"] = "gedcom";
      This line sets the "type" of block. This line is optional. There or two acceptable values for the "type" option: user and gedcom. Setting the type to user will only show this gedcom on the user mygedview portals. Setting it to gedcom will only allow the block to be shown on the gedcom portal welcome page.

      So if you are going to add a block for the temperature in your hometown you could add the following lines to the PGV_BLOCKS array:
      $PGV_BLOCKS["print_hometown_temp"]["name"] = "Temperature in Hometown, IL";
      $PGV_BLOCKS["print_gedcom_news"]["descr"] = "This block will display the current temperature in Hometown, IL";

      hope this helps.

      John

       
    • Ken Nordberg

      Ken Nordberg - 2004-06-20

      Thanks a lot John. That was MUCH easier than I had anticipated.

      Ken.

       
    • Hans Smedema

      Hans Smedema - 2004-06-20

      We also wanted our familiy coat of arms on the welcomes page. Though 'easy' for (PHP) programmers, it's not very easy for non-technical admins of PGV sites.
      Thinking it through, wouldn't a general 'static' HTML block be an idea. A bit similar to the current news, but where the admin can input (x)HTML code. So a block with text and/or images would be simple to add. News can't be used for this, since it's sorted by date. It would also be nice if multiple blocks of these would be possible, each with (seperate) different content. So for example, a block could be put on the left and right side. One with some static text about the site, and one on the right with the coat of arms image.

      Another idea is having a 'static' image block, similar to the random one, but then having the option to select a fixed image from the media list.

       

Log in to post a comment.