phpWebSite Manual
phpWebSite Manual

phpWebSite Resources

Mods

3rd Party Mods

Who's Online
There are currently, 7 guest(s) and 0 member(s) that are online.
You are an Anonymous user.
You can register for free by clicking here
No Members are currently logged in.

Block Maker

Block Maker

The Block Maker Module

Getting Started

Edited by RobertK

Blocks are one of the most basic components of a web site. Blocks created by Block Maker are used for placing small amounts of content on your site (If the content is going to be longer than just a few sentences, then consider creating a PageMaster page).

The Block Maker module can be found under the Site Content tab of your Control Panel. Block Maker's icon shows a cursor hovering over a series of blocks.


Listing Blocks

The first time you enter the Block Maker module you see a listing of all blocks currently in the database. You can always return to this list from anywhere in the module by clicking the List Blocks link at the top of the page. The listing of the blocks allows you to edit, delete, and activate or deactivate blocks.


  • Clicking the Edit button on the row of the block you wish to edit will take you to a form for modifying that block (editing blocks is explained below).

  • Clicking the Delete button on the row of the block you wish to delete will take you to a Yes/No confirmation. This confirmation makes sure you want to delete the block selected. Ensure that you have selected the correct block and you want to permanently delete it (There is no recovery after you click Yes). Click No to cancel the deletion process.

  • Clicking the Activate or Deactivate button on the row of the block you wish to change will determine whether or not the block is viewable to the public.


Create a New Block

Creating a new block is quite easy. Just follow the directions below and you will be done before you know it.


  1. Click the Create A New Block link at the top of the page. This takes you to the form you need to fill out. If at anytime you wish to cancel what you are doing just click the Back to Main link at the top of the page.

  2. Next fill out all of the necessary fields. The Title, Content, or Footer fields are not required, but if you don't put any content in the block the block will not be created.

  3. The Title field is used as just that, a title. It also represents the block in the list of blocks mentioned above.

  4. The Content field is where most of your information will go. There is a small wysiwyg provided here for those with javascript enabled. The wysiwyg gives you the ability to easily add several different html tags into your content.

  5. The Footer field is rarely used and must be supported by the boxstyle the block is using. You can ignore it.

  6. The Default Theme Variable is used for the placement of the block on your site. This is not set in stone and can be moved later via the Layout Admin module's box move. The choices in this dropbox explain exactly where on the site the block will be placed by default (see Figure 1).



  7. The Allow View option enables you to select which modules must be active in order for the block to appear. For instance, you can select PageMaster and the block will only be viewable when a PageMaster page is being viewed. Most of the time you will select all the modules so the block can always be seen (To select all modules, simply do not select any: the saved block selects all by default).

  8. When you are done click the Save Block button and you will be returned to the listing of blocks.

  9. Now you will need to choose Activate in order to make the block viewable to the public.


Editing Blocks

Editing a block is much like creating a new block except all of the fields are pre-populated with the data that was entered when creating this block. If at anytime you wish to cancel what you are doing just click the Back to Main link at the top of the page.


  • Now you can modify the content in the block and change its allow view options. The only thing you can't change here now is the theme variable you chose when creating a block. This has to now be modified by the Layout Admin module's box move.

  • When you are done editing the block click the Save Block button and the block will be saved to the database and return you to the list of blocks.

  • Make sure the changes you made are correct because they will go live as soon as you save the block (You may wish to deactivate it before you begin to edit, then activate it again when you are finished).



Created on 07/26/2003 12:29 AM by RobertK
Updated on 04/11/2004 09:56 PM by RobertK
 Printable Version

Comments - Please Log In to make a comment
The comments are owned by the poster. We are not responsible for its content.
IFrame
Posted on: 11/12/2004 12:05 PM   By: Anonymous
I have a forums site made by ASP & I want to display it on IFrame Tag .., on a Page .., how to do it .., It always give me nothing or cant display this page .., back to localhost
"comment this ASPSite is not on my computer , it's Online"
Re: IFrame
Posted on: 11/12/2004 12:36 PM   By: Anonymous
I got this error Msg in the Page section:

The filename, directory name, or volume label syntax is incorrect.

I followed the Instructions say :
---------------------------------
a. In the first section, select one of the three page_insert templates
from the drop-down template menu.
b.Enter the URL of the page you want inserted as the text of the
section. The URL can be a full URL (i.e., http://mysite.com) or
a relative link to a file on your site (e.g., downloads/cool.html).
4. Save the section
------------------------
My Exact page I want to Display is :

http://ccc.domaindlx.com/gamal/Forum/default.asp
Re: IFrame
Posted on: 12/04/2004 03:25 AM   By: Anonymous
The obvious questions are:
1. Can you load the forum *outside* of the iframe?
2. Did you add to textSettings.php?
Random Block Sample
Posted on: 12/11/2004 02:10 PM   By: jhawkins
I had the need to randomly display blocks on a site and wanted the blocks to display random product information. The simpliest method that I found to do this was to embed a simple javascript in the block. I've attached a clean example of the script to this post in case others have a similar need.

NOTE: When I previewed this post I noticed that my tags were stripped, which makes sense. You will need to replace tag with the appropriate 'greater than and less than characters.

For this script to work you MUST enable the script tag in conf/textsettings.php! I update all of my sites to use the 'super-hack' patch which allows the deity this priviledge.

Sample Script:

TAGscript language="JavaScript"TAG
var Block=new Array() // do not change this!

// Set up the blocks to be shown, below.
// To add more blocks, continue with the
// pattern, adding to the array. Remember
// to increment the Block[x] index!
// If a block needs to contain double quotes you must
// preceed each double quote
// with a back slash. See example in sample block 2.
//
//You should place a default block between the noscript
//tags located at the end of this script for those who
//do not have java enabled in their browser.
//
Block[0] = "Random Block 0";
Block[1] = "Random Block 1";
Block[2] = "This "Random Block 2" contains double quotes";
Block[3] = "Random Block 3";
Block[4] = "Random Block 4";
Block[5] = "Random Block 5";
Block[6] = "Random Block 6";
Block[7] = "Random Block 7";
Block[8] = "Random Block 8";
Block[9] = "Random Block 9";

// ======================================
// Do not change anything below this line
// ======================================
var Q = Block.length;
var whichBlock=Math.round(Math.random()*(Q-1));
function showBlock(){document.write(Block[whichBlock]);}
showBlock();
TAG/scriptTAG

TAGnoscriptTAG
Put a default block here for those who do not have java enabled.
TAG/noscriptTAG

Edited By: jhawkins On: 12/11/2004 02:15 PM
Page Specific Blocks
Posted on: 12/11/2004 03:50 PM   By: jhawkins
I needed to be able to display block text for specific pages on one of my sites. I created the following javascript to enable me to do this.

NOTE: You need to enable the script and noscript tages in /conf/textsettings.php for this to work. I install the super-hack patch to do this. The patch that I obtained was at bygeorgeware.com.

Also not that you need to replace TAG with the appropriate less than or greater than character as the message boards strip them from the script.

To use this script you will need to create/copy a conditional if statement for each page and insert the appropriate url and block content for each condition.

TAGscript language="JavaScript"TAG
function displayblock() {
if( location.href == "http://www.yourdomcin.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=9&MMN_position=9:9") {
document.write("Page 9 Content")
}
if( location.href == "http://www.yourdomcin.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=8&MMN_position=8:8") {
document.write("Page 8 Content")
}
}
displayblock();
TAG/scriptTAG
// The following block displays a message for
// those browsers with java not enabled.
// Replace with an appropriate message.
TAGnoscriptTAG
This block requires java enabled in your browser!
TAG/noscriptTAG
More elegant page specifc script
Posted on: 12/14/2004 01:23 PM   By: jhawkins
I needed to use my page specfic script and decided to make some changes that make it easier to use. Sorry that phpwebsite strips the linefeeds from the code so the formatting looks bad.

Regards,
jhawkinsvalrico

<script language="JavaScript"> var WhichContent=0; // pointer to the deault content block var Content=new Array() // do not change this! // // Set up the content for blocks to be shown, below. // To add more content blocks, continue with the pattern, // adding to the array. Remember to increment the Block[x] index! // // You should place a default content block between the noscript // tags located at the end of this script for those who // do not have java enabled in their browser. // // This script is setup so that content block 0 is a default // block. This is done because a block will be displayed on all // pages of the category you select. // Content[0] = "Default Content Block 0"; Content[1] = "Content Block 1"; Content[2] = "Content Block 2"; Content[3] = "Content Block 3"; Content[4] = "Content Block 4"; Content[5] = "Content Block 5"; Content[6] = "Content Block 6"; Content[7] = "Content Block 7"; Content[8] = "Content Block 8"; Content[9] = "Content Block 9"; function setContent() { if( location.href == "http://www.yourdomain.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=9&MMN_position=9:9") { WhichContent=1; } if( location.href == "http://www.yourdomain.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=8&MMN_position=8:8") { WhichContent=2; } } // ====================================== // Do not change anything between this line // ====================================== setContent(); document.write(Content[WhichContent]); </script> <noscript> // ====================================== // and this line! // // ====================================== // The content between the noscript tags // will be displayed for those browsers // that do not have javascripting enabled. // You should put some default content // here! // ====================================== // Put a default block here for those who do not have java enabled. </noscript>
Edited By: jhawkins On: 12/14/2004 01:34 PM
Random Blocks?
Posted on: 01/08/2005 12:21 PM   By: Anonymous
Well, actually not quite so random. Is there a way to create a block for say "Latest gallery upload" or "latest product" "latest freebie" etc, without having to go in and manually change all the images/links on each individual block?

Would it also be possible to have say "latest blog entry" but only have the first sentence show up? or even just the title of the blog entry?
Re: Random Blocks?
Posted on: 02/05/2005 03:43 AM   By: Anonymous
I wish to display weather info in a block. The javascript the source page suggests is




However all I have is an empty block. What am I doing wrong?
Re: Random Blocks?
Posted on: 02/05/2005 04:01 AM   By: Anonymous
Sorry!! I wish to add weather info to the page the code I'm supposed to enter is
"
"

But as you can see it disappears whenever I enter it?? What should I do
Re: Random Blocks?
Posted on: 03/04/2006 10:11 PM   By: Anonymous
I know I'm a little late, but I thought I'd post this in case someone was looking for this info. If you want to add your YouTube videos to a block, you need to go to conf/textSettings.php and add the tags: object, param, embed to the allowed tags list. Then the video will display fine.
Box with Read More link
Posted on: 03/05/2006 12:50 AM   By: Anonymous
Is is possible for blocks to have a Read More link just as Announcements do? That would be a great option, and I'm surprised it's not already intergrated.
Calendar
Posted on: 11/13/2008 05:15 PM   By: Anonymous
Très intéressant pour les dernières nouvelles de CNN, France24, EuroNews
Files
Posted on: 11/13/2008 05:21 PM   By: Anonymous
Warnmeldungen und Aktuelle Nachrichten für alle auf der ganzen Welt 24 Stunden am Tag.


Sponsored by Patterson Research
Founded by Robert Kennedy
Powered by phpWebSite