By: hozyali
Date: 2010-08-02
Time: 22:07
|
MergeBlocks need a php variable from another mergeblockHi,
As the subject defines, I need to pass a sub category ID to my 2nd Mergeblock SQL. I could not find a way to do it, can someone please help? Here is the example I need to do.
Please help. thanks |
|||||
By: Skrol29
Date: 2010-08-02
Time: 22:48
|
Re: MergeBlocks need a php variable from another mergeblockHi, Hozyali,
This is the purpose of subblocks. See alone examples and also the manual: http://www.tinybutstrong.com/manual.php#html_block_subblock |
|||||
By: hozyali
Date: 2010-08-02
Time: 23:31
|
Re: MergeBlocks need a php variable from another mergeblockthanks Skrol29,
I got it. but can you tell me how do I echo the actual statement to verify that my sql query is working or not? Because, when I pass the variable to the subcat query, its not returning what it should. thanks for your help. |
|||||
By: Skrol29
Date: 2010-08-02
Time: 23:42
|
Re: MergeBlocks need a php variable from another mergeblockHi,
Try with TbsSQL, it has a trace mode. But take the 3.0-beta, this is the only one where the trace mode works with TBS's MergeBlock. The beta is available here: http://sourceforge.net/projects/tinybutstrong/files/ |
|||||
By: hozyali
Date: 2010-08-02
Time: 23:45
|
Re: MergeBlocks need a php variable from another mergeblockdon't really want to go in that much.
actually the subcategory table and fields are also same, it just checks if the cat_parent field is equal to maincat id. the result shows me the same result as the main cat. that means that the varible in 2nd sql is empty and defaults to 0 itself. please advise. |
|||||
By: Skrol29
Date: 2010-08-03
Time: 01:20
|
Re: MergeBlocks need a php variable from another mergeblockCan you post your new MergeBlock commands and a snippet for block and subblock ?
|
|||||
By: hozyali
Date: 2010-08-03
Time: 08:30
|
Re: MergeBlocks need a php variable from another mergeblockyes here it is
below is the Blocks code with the variable
here is the template blocks
Also can you advise what language support should we implement, I mean should implement language by using static language files made in php or mysql? what is efficient to make a robust application? appreciate your help. thanks |
|||||
By: Skrol29
Date: 2010-08-03
Time: 09:40
|
Re: MergeBlocks need a php variable from another mergeblockHi,
First the subblock feature is activated since there is a "p1" parameter in the subblock definition in the template side. Thus you should replace
You also have to use %p1% in the SQL query:
The last think to have it working is that the main block should surround the subblock. This is quite logical, the main block has to make the subblock be repeated. So you should replace
|
|||||
By: Skrol29
Date: 2010-08-03
Time: 09:42
|
Re: MergeBlocks need a php variable from another mergeblock> should implement language by using static language files made in php or mysql
Can you precise your question ? |
|||||
By: hozyali
Date: 2010-08-03
Time: 09:51
|
Re: MergeBlocks need a php variable from another mergeblockhi,
I mean should I make language files for example /lang/english.php /lang/french.php OR I should manage languages from mysql database thanks |
|||||
By: hozyali
Date: 2010-08-03
Time: 09:58
|
Re: MergeBlocks need a php variable from another mergeblockregarding your suggestion about the menu, it worked but not exactly. now it removed the main category names and just showed all the subcats.
anyway, I wanted to know this. Is there any nice CSS drop down you know which is either already integrated to TBS or much easier to integrate? I just want to populate sub categories when mouse hovers on a main category. I will be using this menu on top of my website under header. thanks a lot for your help. |
|||||
By: Skrol29
Date: 2010-08-03
Time: 10:48
|
Re: MergeBlocks need a php variable from another mergeblockAbout multilanguage support, I would say that if you've designed your application having in mind that the texts are part of the design, and should be managed by technical people only, the it should be in a PHP file. Like most of the CMS I've met do.
In the other hand, if you put them in SQL, then you can develop a screen to add more language and have translations made of fixed by other users. There is also a topic about TBS and multi-language here: http://www.tinybutstrong.com/forum.php?msg_id=2714# |
|||||
By: hozyali
Date: 2010-08-03
Time: 21:51
|
Re: MergeBlocks need a php variable from another mergeblockHi,
I have got the menu category issue sorted and its working fine now. I have another question. I have a block with recordset and its looping. In the template, I need to put a condition. Here is an example of my php code
The above code basically sets the directory names depending on the mysql field value. I think the above code is self explanatory. Kindly help how do I do this using TBS template. Thanks |
|||||
By: hozyali
Date: 2010-08-03
Time: 21:56
|
Re: MergeBlocks need a php variable from another mergeblockI also need to take array or field values in PHP using MergeBlock, can you please advise how can I do that?
for example
from the above query, I need the itemID in PHP to do other actions. Please help |