Plaguing Issue - with regards to multiple sections posting in viewers

8 posts by 4 authors in: Forums > CMS Builder
Last Post: March 22, 2010   (RSS)

By Codee - February 11, 2010 - edited: February 12, 2010

Hi IT and Dave,

this is a follow up to another thread in which Dave Edis wrote and I could seriously use some support and attention on - thanks in advance!:
Hi equinox69,

The "related records" feature is only for the cms admin. So you could, for example, list all the models a manufacturer had on the "Edit Manufacturer" page.

It's not used in the code generator. Or rather, it shouldn't be. But being a beta it looks like it's outputting that field. We'll remove that for the next beta.


I think I may not be clearly stating what I'm thinking or wanting to do. This is not something I would want removed from automatic code generation, but rather ADDED.

As I understand it, and am experiencing right now is this for example:
A site has sections such as Inventory, Make, Model and the Inventory section pulls Make data from the Make section and the Model data through the Make section (because Model is a subsection of Make). However, generating the viewer code to display the makes and models for Inventory Viewers (list pages and detail pages) doesn't happen automatically and it's been a real plague to make them appear or appear properly with custom coding. My thought is this: if CMSB utilizes the ability to have the Makes/Models injected into the Inventory record then the code generator should recognize this and generate appropriate code.

Please be patient with me if I'm missing something obvious...why wouldn't CMSB generate such relevant code. The application for pulling data from other sections and subsections into a single section would seem is a critical and much used feature in CMSB, so ensuring/supporting the viewer code to allow/enable that process would be just as important. I don't see this as a needed custom-coded process because the referencing is already built into CMSB.

If it's not something that you intend the CMBSB code generator to support, then how about a simple tutorial with code snippets be provided, maybe in the docs? Maybe something along the lines of "The CMSB Code Generator only produces the basic code for a single sections viewers. If you have need to display related lookup data (like pulling a list of manufacturers and models from a separate section into a product list section) then this tutorial will show you how to have the Viewers display properly."

Is this something that other CMSB users are having a challenge with, or am I missing something obvious?

As always, thanks in advance. This product has been, and continues to be, an amazing part of my web toolchest.

Re: [equinox69] Plaguing Issue - with regards to multiple sections posting in viewers

By Dave - February 15, 2010

Hi equinox69,

I know what you mean. The short answer is that it doesn't do that right now, but we hope to automate some of those features in future.

We've added to code to inject values after the results have been loaded, but this method doesn't make those values searchable (as that needs to happen in MySQL).

Merging multiple tables and searching or returning their results requires something called "SQL Joins" and making these work automatically with all the possible fields people use is not something we've figured out yet.

We have some ideas, though, and plan on working on that more in the future. In part because we're writing custom code for those multi-table scenarios as well, and we'd prefer to have that automated for ourselves!

And because it's so complicated, I can't think of a simple tutorial. It really gets into learning SQL, which is a big topic. CMSB uses maybe 5% of the capabilities of SQL, but that's enough to handle 90% of most people's requirements.

So we're still writing custom code for those remaining special cases. But you can count on the fact that the more time we spend writing custom code for something, the more time we'll be spending thinking about how to automate it! :)

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Plaguing Issue - with regards to multiple sections posting in viewers

By Codee - February 15, 2010

Hmmm, okay, Dave. Maybe just my ignorance of the issues involved but it would seem to me that although making it work for all cases could be extremely complicated, that there could be a simple generalized join-type tool (for a specific set of section names and maybe a short relational tree) that could be adapted if the relationship group isn't compromised...at least for a short-term tool until something more complex is developed. Having the ability to have cross-sectional data and searching that data for at least a group or two is a fairly important tool for a CMS like this. Thanks for working on it.

Re: [Dave] Plaguing Issue - with regards to multiple sections posting in viewers

By kitsguru - March 22, 2010 - edited: March 22, 2010

I have a similar but opposite problem, the solution to both might be the same or similar. I have different listing views but the same detail page. When the user wants to return to the list view, there is no current automatic mechanism to determine which list view they came from. Also I want the user to return to the same page they came from not the first page.

As for the complex SQL, why not add support for stored procedures in mysql 5+. As long as the server returns a result set, nothing really is different on the coding side to display records. For those of us familiar with SQL this would be a not brainer.[:P]

here is a php snippet to call a stored procedure
<?php

if ($result = mysqli_query($link, "call se_proc('crm')")) {



while( $row = mysqli_fetch_array($result) ){

echo ($row[0]. "--------- SR. " . $row[1] . "<br>");

}


mysqli_free_result($result);
}


?>
Jeff Shields

Re: [kitsguru] Plaguing Issue - with regards to multiple sections posting in viewers

By flamerz - March 22, 2010

Maybe you can use an option in the url, like this:

http://www.yourwebsite.com/detail.php?myitem&opc=buy <- here option is buy

http://www.yourwebsite.com/detail.php?myitem&opc=rent <- here option is rent

and you can generate a back link with that option.

i hope you can get it... tell us [:)]

another easy way is...

<a href="javascript:history.go(-1)">Go back</a>

Re: [flamerz] Plaguing Issue - with regards to multiple sections posting in viewers

By kitsguru - March 22, 2010

I can call my detail page ok with with your example. What I need to know is how do I replace:

<?php echo $listingsMetaData['_listPage']; ?>

with different _listpages as they are different.
example
buy.php?page=3 or rent.php?page=3
Jeff Shields

Re: [kitsguru] Plaguing Issue - with regards to multiple sections posting in viewers

By Dave - March 22, 2010

The _listPage field is just for convenience. For the more advanced setup that you have I would just skip it and create the return url yourself.

You could store the previous url in the current url or $_SESSION.

Or, if you want to keep using _listPage for consistency you could overwrite it's value at the top of the script based on what the previous page was.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com