6 of 8
6
Multi Text
Posted: 05 November 2007 12:54 AM   [ Ignore ]   [ # 91 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  573
Joined  08-31-2005

a few people have mentioned it, but i dont know if there was a solution yet… Is there a way to check if a column is empty? Ex:

{if col_1!=""}


Also, did read somewhere correctly that errors occur if any fields are left blank?

Profile
 
 
Posted: 15 November 2007 01:52 PM   [ Ignore ]   [ # 92 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

Like ira42‘s post above says, I too would like to sort the results on the template by one of the columns. I can think of two ways this could be done (totally riffing here, so I might be crazy):

1. In the entry in the control panel by dragging the rows up and down (yay asynchronous Javascript) which I’m sure would be a significant rewrite.

2. On the template level - maybe with the query module, or adding a new output parameter like:

<ul>
{members col_1="available" sortcol="col_2" sortorder="desc"}
<li><strong>{col_1}</strong>: {col_2}</li>
{/members}
</ul>


I’d then assume that the above would grab every line where {col_1} equals “available” and then sort them by {col_2}, descending.

I guess a significant problem would arise if one was trying to sort by numbers (in my real-life working-on-it-right-now case that would be square footage). I’m not sure how these fields are stored in the database but it’s some form of text I would guess.

I’d almost prefer the “drag to sort” method in the Control Panel, myself.

Any tips or tricks welcome, and I’ll post something here if I figure out anything interesting!

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 26 November 2007 10:03 PM   [ Ignore ]   [ # 93 ]  
Lab Technician
RankRankRankRank
Total Posts:  1015
Joined  03-25-2005

I must be missing something.
Installed extension.
Added a custom field called multi
Named columns One Two Three to test.

Tried everything cannot get them to show in template.

Help please…
Updated Jan 02, ok, figured it out…

 Signature 

BKDesign Solutions - Learn XHTML and use   Web Standards to build accessible websites that validate

Profile
 
 
Posted: 02 December 2007 02:05 PM   [ Ignore ]   [ # 94 ]  
Grad Student
Rank
Total Posts:  89
Joined  03-20-2007

I would like to say THANKS for Multi-text - cool extension smile

Sorting for 1 col would be cool as a feature for the future.

Nevertheless Thumbs up!

2nd

Profile
 
 
Posted: 02 January 2008 02:32 PM   [ Ignore ]   [ # 95 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

Does anyone have an answer to this question?

Is

{if col_1!=""}

possible?

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 02 January 2008 02:46 PM   [ Ignore ]   [ # 96 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

Yes, you can do that sort of thing. I actually have the very template open right now on which I’m doing that. What a coincidence! Note that to get it to work you might have to do it like this:

{if "{col_9}" != "" }

Actually - I don’t think you can keep any fields blank with this extension. I made it very clear to my client that they need to put a hyphen in any field for which they have no info - so I test against a hyphen.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 02 January 2008 03:00 PM   [ Ignore ]   [ # 97 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

Perfect!! Thank you a ton Ryan.

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 04 January 2008 02:48 PM   [ Ignore ]   [ # 98 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-30-2007

I keep getting stuck with this extension, it doesn’t seem to record empty rows or empty text fields.

Is it possible if I change the extension file to make it pre-populate each text field with a single letter such as “x” so that when the table is displayed I know what fields are empty.

What would I need to change?

I’d appreciate any help.

Profile
 
 
Posted: 04 January 2008 03:00 PM   [ Ignore ]   [ # 99 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

Try changing line #384 in ext.multi_text.php from

$r .= "<input name=\"field_id_".$row['field_id']."_".$row_count."_".$i."\" value=\"";

to

$r .= "<input name=\"field_id_".$row['field_id']."_".$row_count."_".$i."\" value=\"X";

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 04 January 2008 03:05 PM   [ Ignore ]   [ # 100 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

Nevermind, my above solution doesn’t work perfectly. Let me look at it again.

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 04 January 2008 03:06 PM   [ Ignore ]   [ # 101 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-30-2007

grazie

it appears to work

Profile
 
 
Posted: 04 January 2008 03:12 PM   [ Ignore ]   [ # 102 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  222
Joined  08-07-2005

It works correctly on a new entry, but not on an edited entry. It adds another dash in the fields for edited entries… at least it’s doing that on my end.

 Signature 

Anna Brown ~ {MediaGirl} ~ {Portfolio}
Providing web programming services for creative agencies & designers.

Profile
 
 
Posted: 04 January 2008 05:13 PM   [ Ignore ]   [ # 103 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-30-2007

It works correctly on a new entry, but not on an edited entry. It adds another dash in the fields for edited entries… at least it’s doing that on my end.

Gotcha.

I did a bit of work on it with clear and blur fields and I got it to work.

I also got rid of it adding an extra row.

All the corrections I made are in the Publish function.  I have to post these corrections in multiple messages because the character length requirements for this forum.

This is replacing the js starting on line 253

function newMultiTextRow(reference, field)
                
{
                    
if(!document.getElementById) return false;
                    if(!
document.getElementById("field_id_"+field+"_table")) return false;
                    
                    var
table = document.getElementById("field_id_"+field+"_table").getElementsByTagName('tbody').item(0);
                    var
trs = table.getElementsByTagName("tr");
                    var
row_count =  reference.getAttribute("numRows"); // trs.length - 1;
                    
var cells = trs.item(1).getElementsByTagName("td");
                    var
cell_count = cells.length;
                    
                    var
new_tr = document.createElement("tr");
                    for(
i=0; i<cell_count-1; i++)
                    
{
                        td
= document.createElement("td");
                        
input = document.createElement("input");
                        
input.name = "field_id_"+field+"_"+row_count+"_"+i;
                        
input.style.width = "100%";
                        
input.value = "X";
                        
input.onclick = "clickclear(this, 'X')";
                        
input.onblur = "clickrecall(this,'X')";
                        
td.appendChild(input);
                        
new_tr.appendChild(td);
                    
}
                    
var del_td = document.createElement("td");
                        
del_td[removed] = "<a href=\"#\" title=\"Remove Row\" onclick=\"removeMultiTextRow(this); return false;\">(delete)</a>";
                    
new_tr.appendChild(del_td);
                    
                    
table.appendChild(new_tr);
                    
reference.setAttribute("numRows", Number(row_count)+1);
                
}
                
function removeMultiTextRow(anchor)
                
{
                    
if(!document.getElementById) return false;
                    if(!
confirm("Are you sure you want to remove this row?")) return false;
                    
                    var
table = anchor[removed][removed][removed];
                    var
row = anchor[removed][removed];
                    
                    if(
table.getElementsByTagName("tr").length == 2)
                    
{
                        inputs
= row.getElementsByTagName("input");
                        for(var
i=0; i<inputs.length; i++)
                        
{
                            inputs[i]
.value = "";
                        
}
                    }
                    
else
                    
{
                        table
.removeChild(row);
                    
}
                }
                
                
                
function clickclear(thisfield) {
                    
if (thisfield.value == "X") {
                        thisfield
.value = "";
                    
}
                }

            
function clickrecall(thisfield) {
                
if (thisfield.value == "") {
                    thisfield
.value = "X";
                
}
            }

Profile
 
 
Posted: 04 January 2008 05:17 PM   [ Ignore ]   [ # 104 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-30-2007

And I changed this chunk around line 387 (with the new js):

for($row_count=0;$row_count<=count($data)-1;$row_count++)
            
{
                $row_data
= array();
                if(isset(
$data[$row_count]))
                
{
                    $row_data
= preg_split("/[\r\n]/", $data[$row_count]);
                
}
                $r
.= "<tr>";                
                for(
$i=0; $i<$columns; $i++)
                
{
                    $r
.= "<td style=\"width:".round(100/$columns)."%\">";
                    
$r .= "<input name=\"field_id_".$row['field_id']."_".$row_count."_".$i."\" value=\"";
                    if(isset($row_data[$i])) {
                        $r .= $row_data[$i];
                        if($row_data[$i]==''){
                            $r .='X';
                        }
                    }
                    else {
                        $r .='X';
                    }
                    $r .= "
\" onclick=\"clickclear(this, 'X')\" onblur=\"clickrecall(this,'X')\" type=\"text\" style=\"width:100%;\" />";
                    
$r .= "</td>";
                
}
                $r
.= "<td><a href=\"#\" title=\"Remove Row\" onclick=\"removeMultiTextRow(this); return false;\">(delete)</a></td>";
                
$r .= "</tr>";
            
}


Anyway it now works for what I need it to do.

Thanks for getting me started.

Profile
 
 
Posted: 18 January 2008 08:31 AM   [ Ignore ]   [ # 105 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  01-05-2005

Mark, we’re having a slight problem with your extension.

We have 3 columns, but some rows will not always have content in each column.  For example the columns are “Name”, “Link”, “Title”.  Not all the rows will have a link though.  When this happens the content from the 3rd column “Title” moves down into the next row.

Has anyone else come across this?  Is there a workaround?

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 18 January 2008 08:37 AM   [ Ignore ]   [ # 106 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6535
Joined  04-15-2006

Hi there,

Not sure if there was ever a workaround for this but I had this problem too once. I just put a ‘-’ symbol into the fields that didn’t need any information in them. You can probably then in your template just use an {if} statement to say if there is a dash then don’t output the information?

Hope that helps?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 21 January 2008 05:58 PM   [ Ignore ]   [ # 107 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  573
Joined  08-31-2005

Is it possible to have 2 different column configuration instances per weblog?

So if I wanted on field to have a 3 column layout with “Name”, “Date”, and “Year” for one field.
And another field to have a 2 column layout with “Boat Type” and “Age”.

How would I go about doing this?

Profile
 
 
Posted: 23 January 2008 03:55 PM   [ Ignore ]   [ # 108 ]  
Grad Student
Avatar
Rank
Total Posts:  71
Joined  04-30-2007

Is it possible to have 2 different column configuration instances per weblog?

So if I wanted on field to have a 3 column layout with “Name”, “Date”, and “Year” for one field.
And another field to have a 2 column layout with “Boat Type” and “Age”.

How would I go about doing this?

Yes, it is possible. Read Mark’s first post to this thread.

Profile
 
 
   
6 of 8
6
 
‹‹ Settings Not Filling      Invisible CAPTCHA ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64882 Total Logged-in Users: 72
Total Topics: 81808 Total Anonymous Users: 38
Total Replies: 439793 Total Guests: 314
Total Posts: 521601    
Members ( View Memberlist )
Newest Members:  Shrike67Dynamic1justingpticketjendicottdxrsmdanbilly8hrkiliwysso50kexpresso