Dynamic breadcrumb region in oracle APEX

Reason of creating dynamic breadcrumb

Before we dive into the specifics, it’s essential to understand the reson for creating dynamic breadcrumb reagion :

  1. Full control over breadcrumb content and appearance
  2. Breadcrumb content can also be get from custom table joining the APEX breadcrumb view(apex_application_bc_entries).
  3. Breadcrumb content can be chaged based on user action or page content

So, intead of creating breadcrumb region, create a PL/SQL Dynamic Content region In Page 0 

dynamic breadcrumb region
declare
    
    cursor bc_csr is
        select apex_application.do_substitutions(be.url) url,
            apex_application.do_substitutions(be.entry_label) entry_label,
            be.defined_for_page page_id
        from apex_application_bc_entries be
        start with be.defined_for_page = :APP_PAGE_ID
            and be.application_id = :APP_ID
        connect by prior parent_breadcrumb_id = breadcrumb_entry_id
            and prior be.application_id = be.application_id
        order by level desc;
    bc_rec bc_csr%ROWTYPE;
    --
begin
    sys.htp.p('<ul class="t-Breadcrumb">');
    for bc_rec in bc_csr loop
        
            if bc_rec.page_id = :APP_PAGE_ID then
                sys.htp.p('<li class="t-Breadcrumb-item is-active"><span class="t-Breadcrumb-label">'
                    ||apex_escape.html(bc_rec.entry_label)||'</span></li>');
            else
                sys.htp.p('<li class="t-Breadcrumb-item"><a href="'
                    ||bc_rec.url||'" class="t-Breadcrumb-label">'||apex_escape.html(bc_rec.entry_label)||'</a></li>');
            end if;
        
    end loop;
    sys.htp.p('</ul>');
end;

By following these tailoring approach, you can create effective and visually appealing breadcrumbs in your Oracle APEX application.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *