Judah Raine
Total posts: 332
05 Nov 2012 10:55

Hello :D I do so hope someone is around at this time, lol...

Am doing custom template and everything has worked wonderfully except for this:

<

table border=0 summary="";>

<tr>

    <td width=210 rowspan=12><?php echo $field_26 border="0" width="200" height="300" alt="";?></td>

The error message is:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/classicr/public_html/components/com_cobalt/views/record/tmpl/default_record_affiliates.php on line 142

I have tried putting a , or ; between the various "" but nothing has worked - it seems like such a simple line, I would not have thought of this issue happening. If you can spot something I would be most grateful

Last Modified: 02 Mar 2014


Sackgesicht VIP
Total posts: 1,636
05 Nov 2012 12:27

Judah,

hmmm ... maybe you should start with some basic HTML about table design like here or here

1st Line: summary=""; should not be in the table tag

2nd Line : ok :D

3rd Line: I believe it is not $field_26, maybe $field[26] and since you are in "PHP mode" the command echo will only print the content of $field[26] and the rest of the line until the PHP end will create the error.

See PHP echo

I presume you want to display an image --> study first the HTML image tag

It also depends on the content of $field[26]

If you are not sure what the content of a variable is, i suggest to use a tool like J!Dump


Judah Raine
Total posts: 332
05 Nov 2012 21:17

:D More learning curves... I confess I copied and changed one I used previously for MR using a basic html writer I have. Obviously between all these this is the result, so I should have started from scratch. My apologies. And obviously the html tool I have is questionable :D Also downloading JDump as we speak. I also know it's like putting the cart before the horse - ideally I should learn everything I need to know before I do the site. Unfortunately, here in the real world, time is a luxury and I'm already way past my deadline so I'm having to limp along as best I can and learn things the hard way. Thank you for being patient.


Sergey
Total posts: 13,748
05 Nov 2012 22:34

This piece of code make no sense to me. I cannot even correct it because by this code I even cannot understand the purpose. I mean I look at it and not only I cannot say what is wrong but I cannot suggest how to fix it because by this code I cannot understand what user wanted at all.

Please attach description.


Judah Raine
Total posts: 332
06 Nov 2012 11:28

My apologies for not replying sooner, it's been a disastrous day all round :( First, an apology - in my head you guys are the "guru" and in my haste I mistakenly assumed you would be able to read my mind. Incomplete information is utterly useless and I am sorry for that.

Having said that, in my defense I must also say that I tried to adapt a template which worked very successfully in MR but which obviously doesn't "talk" quite the same language as Cobalt. I'm trying to learn the differences as I try to accomplish what I need.

I really am not looking for anything spectacular, just a simple table type format to display the article in a pre-set format. having done that a gazillion times with MR, I didn't expect to encounter difficulties this time around.

I have spent as much time as possible today trying to work this out using the links provided and various other Google forums but cannot as yet test my work as I keep getting an "unexpected ending" error, which I gather means in inserting the table I have disturbed the rest of the php somewhere. I have downloaded a php checker, but as yet the only error I can find is the same unexpected ending. I will persevere and try to resolve it.

In the meantime, what I have come up with is:

result; ?> Genre: result; ?>
Profile: result; ?>
Website: result; ?> Blog: result; ?>

I will attempt to specify the image attributes once I actually get the fields to display correctly. I am assuming that my current error has to do with where I inserted this, but as the php checker is revealing nothing more than the unexpected ending this is taking time.


Sergey
Total posts: 13,748
06 Nov 2012 22:42

Please attach your full file. I cannot understand where you took $field. Because there is nothting like this available. You have to use $item->field_by_id[23]-Юкуыгдею SOmething like this.


Judah Raine
Total posts: 332
06 Nov 2012 23:37

I'm going to look at what you have said a little later, I think it makes sense to my novice brain but in the meantime the file is attached. (And hopefully soon I will cease to be your biggest headache :D)


Sergey
Total posts: 13,748
07 Nov 2012 01:37

Edited this script you have deleted endforeach. I have attached fixed version


Judah Raine
Total posts: 332
07 Nov 2012 08:03

Thank you :D I shall sit and compare yours with mine so I am sure to learn from this - I do appreciate the help


Judah Raine
Total posts: 332
07 Nov 2012 08:23

This definitely makes a lot more sense than what I had and I can see the logical steps, thank you . Just one teeny problem :D The fields are not displaying anything

I notice that the lines that went before, e.g. fields by group etc are not there... could this have something to do with it? I'm going to look at the parameters again, although everything did display fine with the default template


Sergey
Total posts: 13,748
07 Nov 2012 21:08

Tryt o change field_by_id to fields_by_id


Judah Raine
Total posts: 332
07 Nov 2012 22:23

Thank you, I'll try that now :D


Judah Raine
Total posts: 332
10 Nov 2012 08:17

Just to let you know this is working perfectly, thanks so much for your help :D


Sackgesicht VIP
Total posts: 1,636
10 Nov 2012 15:41

Judah,

maybe you want to consider a review of Cobalt in JED, if you are satisfied with the component. :D


Judah Raine
Total posts: 332
10 Nov 2012 21:19

I actually tried to do that yesterday, but for some reason the page wouldn't load for me. I will definitely be doing that as the support here is fabulous :D

Powered by Cobalt