Tiddlypeep replied

56 weeks ago

hey, this may just be my coding (which is rusty to say the least) but i'm having problems sorting the roster page how i would like it, the rank bit had code in it along the lines of {{#ifequal rank 0}} etc allowing u to assign text to peoples rank within the linkshell which worked fine before the actual crossover to v2 and now all of a sudden has stopped working, also i can't get it to only display jobs over level 90. also is there a way for it to show short job names? ie. COR instead of Corsair?

have put my roster coding below, i realise i removed the {{#if equal rank 0}} code etc, i removed this so that something would display instead of it being a blank space. any help would be much appreciated :) loving the new sites btw, very nice^^

<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Character</th>
<th>Rank</th>
<th>Race</th>
<th>Jobs</th>
<th>Relic/Mythic/Emp</th>
<th>Online</th>
</tr>
</thead>
<tbody>
{{#members}}
<tr>
<td>
{{#if avatar}}
<img src="{{avatar}}" class="avatar pull-right" width="18" height="18">
<a href="{{link}}">{{name}}</a>
{{else}}
{{name}}
{{/if}}
</td>
<td>
{{#rank}}
{{name}}
{{/rank}}
</td>
<td>{{race}}</td>
<td>{{#jobs}}
<div style>
{{name}} - {{level}}
{{/jobs}}
</td>
<td>{{#specialItems}}
<div style>
<img src="{{icons.small}}">
<a href="{{link}}">{{name}}</a>
{{/specialItems}}</td>
<td>{{#online}}
<span class="normal">Yes</span>
{{else}}
<span class="muted">No</span>
{{/online}}
</td>
</tr>
{{/members}}
</tbody>
</table>

Gjallarhorn (95) - Obtained Twashtar (90) - Obtained
Pyf Harp - { Iron Plate 50/50} { Colorless Soul 22/75} { Apademak Horn 49/75}
Spharai - { 100 Byne Bill 4/4} { M. Silverpiece 14/14} { L. Jadeshell 0/61} { 100 Byne Bill 0/100}
Armageddon (85) - { Isgebind's Heart 0/75}
Carnwenhan - { Alexandrite - 244/30000} { Balrahn's Eyepatch - Obtained} { W. Areuhat - 90236/150000} {Assaults - 15/50}

Stanislav Staff replied

56 weeks ago

You can use JavaScript to manipulate the data.

each(this.members, function(member) {
  if (member.rank.rank === 0) {
    member.myRankName = "Title 1";
  } else {
    member.myRankName = "Other Title";
  }
})

For connivence you may use this set of utility functions.

http://documentcloud.github.com/underscore/

I hope that answers your question. =)
Founder / Engineer

Tiddlypeep replied

56 weeks ago

thanks for the quick response :) but u'll have to forgive me, my javascript is atrocious, how do i use that in the template so that it displays, i have put the code u gave me in the javascript section and its done nothing so i assume i need to either edit it or add something into the template section so that it displays? also is this method what i'm going to have to use to display only jobs over 90 and to seperate crafts into individual columns for each craft?
sorry for the multitude of questions, but i havent done much coding since i left school like 8 years ago xD

Gjallarhorn (95) - Obtained Twashtar (90) - Obtained
Pyf Harp - { Iron Plate 50/50} { Colorless Soul 22/75} { Apademak Horn 49/75}
Spharai - { 100 Byne Bill 4/4} { M. Silverpiece 14/14} { L. Jadeshell 0/61} { 100 Byne Bill 0/100}
Armageddon (85) - { Isgebind's Heart 0/75}
Carnwenhan - { Alexandrite - 244/30000} { Balrahn's Eyepatch - Obtained} { W. Areuhat - 90236/150000} {Assaults - 15/50}

Stanislav Staff replied

56 weeks ago

For the JS example I gave.

Each member object now has 'myRankName' and when looping within {{#members}} you can just put {{myRankName}}.

You can do the same for any data in the JS.
Founder / Engineer

Stanislav Staff replied

56 weeks ago

You can read more about the template language used here.

http://handlebarsjs.com/
Founder / Engineer

Tiddlypeep replied

56 weeks ago

cheers stan^^

Gjallarhorn (95) - Obtained Twashtar (90) - Obtained
Pyf Harp - { Iron Plate 50/50} { Colorless Soul 22/75} { Apademak Horn 49/75}
Spharai - { 100 Byne Bill 4/4} { M. Silverpiece 14/14} { L. Jadeshell 0/61} { 100 Byne Bill 0/100}
Armageddon (85) - { Isgebind's Heart 0/75}
Carnwenhan - { Alexandrite - 244/30000} { Balrahn's Eyepatch - Obtained} { W. Areuhat - 90236/150000} {Assaults - 15/50}

Tiddlypeep replied

56 weeks ago

i got it to work by referencing the member.rank.name, but i dunno if this is a glitch but everyone in my ls is showing as rank 0 including myself (the shell holder) the sacks and the normal pearl members in the data section of the widget customize page, this is why i couldn't get it to work when referencing the member.rank.rank data

also when trying to make it display the short job names instead of the full ones i tried using the following code

    each(this.members, function(member) {
    if (member.jobs.name === "Corsair") {
      member.myJobsName = "COR";
    }})

it returns "TypeError: member.jobs is undefined"

Gjallarhorn (95) - Obtained Twashtar (90) - Obtained
Pyf Harp - { Iron Plate 50/50} { Colorless Soul 22/75} { Apademak Horn 49/75}
Spharai - { 100 Byne Bill 4/4} { M. Silverpiece 14/14} { L. Jadeshell 0/61} { 100 Byne Bill 0/100}
Armageddon (85) - { Isgebind's Heart 0/75}
Carnwenhan - { Alexandrite - 244/30000} { Balrahn's Eyepatch - Obtained} { W. Areuhat - 90236/150000} {Assaults - 15/50}

Stanislav Staff replied

56 weeks ago

i got it to work by referencing the member.rank.name, but i dunno if this is a glitch but everyone in my ls is showing as rank 0 including myself (the shell holder) the sacks and the normal pearl members in the data section of the widget customize page, this is why i couldn't get it to work when referencing the member.rank.rank data

also when trying to make it display the short job names instead of the full ones i tried using the following code

    each(this.members, function(member) {
    if (member.jobs.name === "Corsair") {
      member.myJobsName = "COR";
    }})

it returns "TypeError: member.jobs is undefined"Tiddlypeep

Not all members have jobs, only ones with a Guildwork account. So you should do an if statement to check if jobs exists before modifying it.
Founder / Engineer

Hyshio Star replied

55 weeks ago

I think Im gonna start bothering you h1pp0 on this stuff soo I can customize both the windower and my LS sites.

Edit: Nvm mistaken you with another coder.


last edited 55 weeks ago by Hyshio Star

Tiddlypeep replied

55 weeks ago

lol no worries :p tho if u need any help with css i'm fine with that, think my ls site looks pretty good now it has global css instead of havin to hack/workaround with html widgets

http://hotelmoscow.guildwork.com/

its just my javascript which is rusty, but i haven't really played with java since i was like 16/17 10 years ago lol, really should go on a java course to get back up to date xD

still can't get the roster page how i want it looking cos i need to do java to make it look good, but oh well i'll keep playing lol


last edited 55 weeks ago by Tiddlypeep

Gjallarhorn (95) - Obtained Twashtar (90) - Obtained
Pyf Harp - { Iron Plate 50/50} { Colorless Soul 22/75} { Apademak Horn 49/75}
Spharai - { 100 Byne Bill 4/4} { M. Silverpiece 14/14} { L. Jadeshell 0/61} { 100 Byne Bill 0/100}
Armageddon (85) - { Isgebind's Heart 0/75}
Carnwenhan - { Alexandrite - 244/30000} { Balrahn's Eyepatch - Obtained} { W. Areuhat - 90236/150000} {Assaults - 15/50}
Please log in to post a reply.