Bancha, Open-source CMS |
[eluser]Nicholas Valbusa[/eluser]
[quote author="kkzhi" date="1335186742"][quote author="Nicholas Valbusa" date="1335177922"] Hello, I used NivoSlider, it's really easy to use: http://nivo.dev7studios.com/ To extract the contents, just create a content type with an images field and extract it on the homepage view as follows: Code: $teasers = find('Teasers')->limit(10)->order_by('date_update', 'DESC')->get(); Nicholas[/quote] Hello Nicholas, thx for the explanation, but its seems like i missunderstood or just dont get it cause it give a warning message like this Code: A PHP Error was encountered can u tell me why? thanks [/quote] Hello, you're likely trying to get a property on a string/array. Could you please send me your homepage.php template so I can help you? Nicholas
[eluser]kkzhi[/eluser]
[quote author="Nicholas Valbusa" date="1335188282"] Hello, you're likely trying to get a property on a string/array. Could you please send me your homepage.php template so I can help you? Nicholas[/quote] Oke this is it Code: <?php i made in a content types("teasers.xml") and i change field id text area to field id="teaser_image" recording to script that u give it to me but seems like it didn't produce any $path in return. and where i put a nivo slider pack that i download before? sorry for the question, i'm just newbie in this
[eluser]Nicholas Valbusa[/eluser]
[quote author="kkzhi" date="1335190866"] Oke this is it Code: .... i made in a content types("teasers.xml") and i change field id text area to field id="teaser_image" recording to script that u give it to me but seems like it didn't produce any $path in return. and where i put a nivo slider pack that i download before? sorry for the question, i'm just newbie in this [/quote] Hello, did you declared the image field like this: http://docs.getbancha.com/content-types/...mages.html If yes, the problem is that you need to check the number of elements in $img before calling an attribute of a null object: Code: $imgs = $teaser->get('teaser_image'); //images field
[eluser]kkzhi[/eluser]
[quote author="Nicholas Valbusa" date="1335192208"] Hello, did you declared the image field like this: http://docs.getbancha.com/content-types/...mages.html If yes, the problem is that you need to check the number of elements in $img before calling an attribute of a null object: Code: ... [/quote] yes i declared the image field just like http://docs.getbancha.com/content-types/...mages.html and after i type this code : Code: $imgs = $teaser->get('teaser_image'); //images field
[eluser]Nicholas Valbusa[/eluser]
[quote author="kkzhi" date="1335194584"][quote author="Nicholas Valbusa" date="1335192208"] Hello, did you declared the image field like this: http://docs.getbancha.com/content-types/...mages.html If yes, the problem is that you need to check the number of elements in $img before calling an attribute of a null object: Code: ... [/quote] yes i declared the image field just like http://docs.getbancha.com/content-types/...mages.html and after i type this code : Code: $imgs = $teaser->get('teaser_image'); //images field Are you sure that you created at least one record of type "Teaser" with an image from the administration? If yes, you can try to check what the record contains (into the foreach cycle) like this: Code: debug($teaser);
[eluser]kkzhi[/eluser]
[quote author="Nicholas Valbusa" date="1335195796"] Are you sure that you created at least one record of type "Teaser" with an image from the administration? If yes, you can try to check what the record contains (into the foreach cycle) like this: Code: debug($teaser); yes i am sure i created a record, and when i debug it produce Code: ------------------- am i wrong in wrote xml file? cos i check with firebug in administration panel , the record (upload field) produce Code: <input type="file" multiple=" " value="" name="[b]teaser_image[][/b]">
[eluser]Nicholas Valbusa[/eluser]
[quote author="kkzhi" date="1335197933"][quote author="Nicholas Valbusa" date="1335195796"](...) really confusing (=_=')[/quote] Please send me the image field xml definition so I can check if is correct.
[eluser]kkzhi[/eluser]
[quote author="Nicholas Valbusa" date="1335195796"] Please send me the image field xml definition so I can check if is correct.[/quote] ok this is it Code: <?xml version="1.0" encoding="utf-8"?>
[eluser]kkzhi[/eluser]
still cant get the teaser_image property in the xml its always return a null value with debug($record->get('teaser_image')); but if i change into other field name it return a result can somebody help?
[eluser]areesto[/eluser]
hi kkzhi, i think you need to add this line : $record->set_documents(); before this one $record->get(‘teaser_image’); hope it work |
Welcome Guest, Not a member yet? Register Sign In |