How to make "empty" view in module?

Author Message

Jerry Jalava

Tuesday 22 July 2003 10:16:17 am

HI,

I'm building a new personal adds module and I would like to know is it possible to make an "empty" view to viewlist...

I tried to search it from other modules, but no module has it...

Explanation: If I have module named "adds", and I have assigned views "view" and "edit" to it.
When I surf to /adds/view I get the "view" view and
when I surf to /adds/edit I get the "edit" view, but if I surf to /adds I get "view '' not found in module adds".

It would be nice if I could redirect /adds/ to ie. /adds/view automagiccally :)

Regards,
Jerry

Selmah Maxim

Wednesday 23 July 2003 12:32:44 am

try this, not sure will work !

$ViewMode = $Params['ViewMode'];
if (!$ViewMode)
$ViewMode="view";

Jan Borsodi

Wednesday 23 July 2003 1:01:53 am

To this you must turn of views for your module by editing module.php and setting

$Module = array( "name" => "Adds",
"variable_params" => true,
"function" => array(
"script" => "adds.php",
"params" => array( "ViewMode" ) ) );

You must then do a check in adds.php for ViewMode and open up the correct script accordingly. Something like.

$viewMode = $Params['ViewMode'];
if ( $viewMode == 'view' )
include( 'path/to/script/view.php' );
else if ( $viewMode == 'edit' )
include( 'path/to/script/edit.php' );
else
include( 'path/to/script/view.php' );

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Jerry Jalava

Wednesday 23 July 2003 9:33:06 am

Thanks, I'll give it a try...

I encountered to other problem...
When I fetch something from template with fetch function, what kind of data my addsfunctioncollection.php should return? (That is the file that returns the data to template after fetch, right?)

It should return somekind of array right? I tracked the module ezurl's functions and founded it too complex for this... ;)

After fetch has been made in template I'm connecting to function_definition.php and through that to addsfunctioncollection.php's function fetchList()... fetchList function gets variables from function fetchListFromDB(). FetchListFromDB returns back to fetchList an arrayquery in a variable and then fetchList returns this to template with [code] return array( 'result' => &$list ); [/code]...
- Should I parse it somewhere before I send it to template?
- How can I get that data in template? ($List:item.?)
- Is there a way to just check everything that comes to template?

OK, I thinks that was already too much to ask, but I hope someone could lighten me up even a bit... I'm soooo close to finnishing this ez portal project. I only need few modules witch I have to make...

Thanks a lot, :D
Jerry

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:22:42
Script start
Timing: Jan 18 2025 22:22:42
Module start 'layout'
Timing: Jan 18 2025 22:22:42
Module start 'content'
Timing: Jan 18 2025 22:22:44
Module end 'content'
Timing: Jan 18 2025 22:22:44
Script end

Main resources:

Total runtime1.3036 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0547152.6250
Module start 'layout' 0.00570.0045 741.679739.4453
Module start 'content' 0.01021.2921 781.1250588.8516
Module end 'content' 1.30220.0013 1,369.976612.1563
Script end 1.3035  1,382.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3071160.0003
Check MTime0.00210.1594160.0001
Mysql Total
Database connection0.00120.091110.0012
Mysqli_queries1.245995.5794620.0201
Looping result0.00070.0566600.0000
Template Total1.264297.020.6321
Template load0.00160.122020.0008
Template processing1.262696.858120.6313
Template load and register function0.00020.011710.0002
states
state_id_array0.00210.157910.0021
state_identifier_array0.00240.185220.0012
Override
Cache load0.00140.1084450.0000
Sytem overhead
Fetch class attribute can translate value0.00070.054930.0002
Fetch class attribute name0.00130.099850.0003
XML
Image XML parsing0.00090.072330.0003
class_abstraction
Instantiating content class attribute0.00000.000650.0000
General
dbfile0.00100.0769170.0001
String conversion0.00000.002540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs